mkr365 Posted August 14, 2008 Share Posted August 14, 2008 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>'; Quote Link to comment https://forums.phpfreaks.com/topic/119734-output-in-2-rows/ Share on other sites More sharing options...
corbin Posted August 14, 2008 Share Posted August 14, 2008 You don't know how to put things in new rows? Look into the HTML markup syntax for tables. Quote Link to comment https://forums.phpfreaks.com/topic/119734-output-in-2-rows/#findComment-616932 Share on other sites More sharing options...
mkr365 Posted August 15, 2008 Author Share Posted August 15, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/119734-output-in-2-rows/#findComment-617180 Share on other sites More sharing options...
corbin Posted August 15, 2008 Share Posted August 15, 2008 So you want everything to show up on 1 page? Quote Link to comment https://forums.phpfreaks.com/topic/119734-output-in-2-rows/#findComment-617639 Share on other sites More sharing options...
mkr365 Posted August 16, 2008 Author Share Posted August 16, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/119734-output-in-2-rows/#findComment-617916 Share on other sites More sharing options...
Mchl Posted August 16, 2008 Share Posted August 16, 2008 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(); Quote Link to comment https://forums.phpfreaks.com/topic/119734-output-in-2-rows/#findComment-617935 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.