Hi,
I'm working on a page that displays the entire range of products...
I query the database to get all the info I need and limit it to 16 records.
The info is then retuned and layed into a two column table and should be 8 rows down with a full set of 16 results.
¦result 1 ¦result 2 ¦
¦result 3 ¦result 4 ¦
The problem I am having is getting the second result to go into the second column instead of it just placing result 1 in column 2 and then result 2 in both columns on the next line down.
I will also need this to continue so it has one result per cell... so it should look like
¦1¦2¦
¦3¦4¦
¦5¦6¦
etc etc
at the moment it jus does this
¦1¦1¦
¦2¦2¦
¦3¦3¦
etc etc
PLease help....
<table cellpadding="0" cellspacing="0" align="left" width="750" border="0">
<?php
include "../php/common_db.inc";
$link_id = db_connect();
mysql_select_db("iiwii");
mysql_close($link_id);
$link_id = db_connect($default_dbname);
if(!$link_id) error_message(sql_error());
if(!$id){ $id = 1; }
$query = "select * from gallery where active='Y' limit 16";
$result = mysql_query($query);
while($myrow = mysql_fetch_row($result))
{
$id = $myrow[0];
$ref = $myrow[1];
$title = $myrow[2];
$desc = $myrow[3];
$image = $myrow[7];
$price = $myrow[4];
$large_image = $myrow[8];
$small_image = $myrow[6];
$model = $myrow[10];
$model_image = $myrow[11];
$colour = $myrow[9];
?>
<tr>
<td align="left" valign="top" width="128"><a href="javascript😛opUp100('../gallery/large_view.php?image=<?php echo $large_image ?>&colour=<?php echo $colour ?>')"><img src="../images_gallery/s/<? echo $small_image ?>" width=125 height=100 alt="view design actual size" border="0"></a></td><td align="left" valign="top" width="247"><font face="Arial, helvetica, sans-serif" size="2" color="#000000"><b><? echo $title ?></b>: <? echo $ref ?><br><b><? echo $desc ?></b><br><a href="../gallery/gallery.php?id=<? echo $id ?>">View in gallery</a><br></font></td>
<td align="left" valign="top" width="128"><a href="javascript😛opUp100('../gallery/large_view.php?image=<?php echo $large_image ?>&colour=<?php echo $colour ?>')"><img src="../images_gallery/s/<? echo $small_image ?>" width=125 height=100 alt="view design actual size" border="0"></a></td><td align="left" valign="top" width="247"><font face="Arial, helvetica, sans-serif" size="2" color="#000000"><b><? echo $title ?></b>: <? echo $ref ?><br><b><? echo $desc ?></b><br><a href="../gallery/gallery.php?id=<? echo $id ?>">View in gallery</a><br></font></td>
</tr>
<?
}
?>