Jump to content

Archived

This topic is now archived and is closed to further replies.

mkr365

output in 2 rows

Recommended Posts

Hi,

 

My output shows up in a table with just 1 row, is it possible that my output shows up in a table with 2 rows? I'm not sure where to start :-[

A little help would be great!

 

<?php
include("test.php");



echo '<div id="content">';


if (isset($_GET['zoekletter']) || isset($_GET['zoek']))
{
if (isset($_GET['zoekletter']))
{
	echo 'gezocht op letter '.$_GET['zoekletter'].'<br><br>';

	$sql = "SELECT * FROM klantgegevens INNER JOIN rubrieken ON klantgegevens.Rubriek = rubrieken.RubriekID INNER JOIN groepen on rubrieken.GroepID = groepen.GroepID WHERE Bedrijfsnaam LIKE '".$_GET['zoekletter']."%' AND groepen.Groepnaam = 'Architect' GROUP BY Bedrijfsnaam ORDER BY Bedrijfsnaam ";
	$result = mysql_query($sql) or die(mysql_error()); 
	$query = mysql_num_rows($result);

	if ($query > 0)
	{
		if ($query < 15)
		{
			while($query = mysql_fetch_array($result))
			{
				$check = url_exists($server.'logos/'.$query['Portfolio'].'.jpg');
				if ($check == true)
					$imageurl = 'logos/'.$query['Portfolio'].'.jpg';
				else
					$imageurl = $default;

				echo '<table bgcolor="#ffffff" class="border1" onclick=window.open("http://www.test.nl/'.$query['Portfolio'].'")  style="cursor:pointer" onmouseover=style.borderColor="#000000" onmouseout=style.borderColor="#ffffff" width="100%"><tr><td width="35%" rowspan="6" ><img src="'.$imageurl.'"></td><td width="15%">Bedrijfsnaam:</td><td width="50%">'.$query['Bedrijfsnaam'].'</td></tr>
				<tr><td width="15%">Adres:</td><td width="50%">'.$query['Straat'].' '.$query['Huisnummer'].' '.$query['Toevoeging'].'</td></tr>
				<tr><td width="15%">Postcode:</td><td width="50%">'.$query['Postcode'].'</td></tr>
				<tr><td width="15%">Provincie:</td><td width="50%">'.$query['Provincie'].'</td></tr>

				<tr><td width="15%">Portfolio:</td><td width="50%"><a href="http://www.test.nl/'.$query['Portfolio'].'" target="_blanc">www.test.nl/'.$query['Portfolio'].'</a></td></tr>
				</table><br><br>';

Share this post


Link to post
Share on other sites

You don't know how to put things in new rows?  Look into the HTML markup syntax for tables.

Share this post


Link to post
Share on other sites

Well i dont think its that simple. Let me explain the situation a little bit more.

 

I have in my database lets say several companies, now if you do a search for example on the fist letter of a company on my site i want that output in 2 rows.

 

At the moment the output shows up in 1 row with a maximum result of 15 companies, everything above the 15 shows up on the next page.

 

 

 

 

Share this post


Link to post
Share on other sites

Well not really, i will give you an example:

 

This is how it show up right now:

 

company1

 

company2

 

company3

 

etc

 

 

And i want it like this

 

company1    company2

 

company3    company4

 

etc

 

 

 

Share this post


Link to post
Share on other sites

These are two columns, not two rows. That's where the confusion came from.

 

I'd go somewhere like this:

 

html_table_header();
html_begin_table_row();
i = 0;
while($query = mysql_fetch_array($result)) {
html_company_data();
i++;
if ((i % 2) == 0) {
  html_end_table_row();
  html_begin_table_row();
}
}
html_end_table_row();
html_end_table();

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.