Jump to content

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>';

Link to comment
https://forums.phpfreaks.com/topic/119734-output-in-2-rows/
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.

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/119734-output-in-2-rows/#findComment-617180
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();

Link to comment
https://forums.phpfreaks.com/topic/119734-output-in-2-rows/#findComment-617935
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.