Jump to content

unexpected {


mindapolis

Recommended Posts

For that kind of layout you would be better using CSS. I don't think that you can nest tables within table cells (never tried)  so I don't see you getting the layout that you are looking for without CSS.

 

if you just want to use your current table and add another product listing on the same row change the contents of the while loop to include an if statement that will check and set a second product on the same row before droping down to the next we can use that little $i variable that's just hanging about at the top of the loop:

$i = 0;
        echo = "<table><tr>";
        while ($row = mysql_fetch_array($result_set))
        {
           echo"<td>{$row['product_id']}</td><td>{$row['product_title']}</td><td>{$row['product_Description']}</td><td>{$row['product_price']}</td>";
           if ($i >= 1){echo "</tr><tr>"; $i = 0;}else{$i = $i++;}
        }
        echo "</tr></table>";

Link to comment
https://forums.phpfreaks.com/topic/248573-unexpected/page/2/#findComment-1278680
Share on other sites

Archived

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

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