Hi Everybody,
I've written a simple database and have got it all running through my website but the customer wants a different layout and I can't work out how to tell the MySQL query and Rows to go into the write Tables.
The script is:-
$query = "SELECT CONCAT(thumbnail_source) AS thumby, CONCAT(prod_name) AS prodname, CONCAT(prod_id) AS pid, CONCAT(prod_price_uk) AS pprice FROM products WHERE prod_category = 'carinterior'";
$result = @mysql_query ($query);
$num = mysql_num_rows ($result);
while ($row =
mysql_fetch_array($result, MYSQL_NUM)) {
echo '<tr valign="top"><td width="23%"><img src="';
echo stripslashes($row[0]);
echo '" width="50" height="50" border="0"></td><td width="37%"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><font color="#CC0000">';
echo stripslashes($row[1]);
echo '
</font>Price: £';
echo stripslashes($row[3]);
echo ".00
<a href=\"product_page.php?pid={$row[2]}\"><img src=\"images/moreinfo.gif\" width=\"167\" height=\"28\" border=\"0\"></td>";
echo '<td width="23%"><img src="';
echo stripslashes($row[0]);
echo '" width="50" height="50" border="0"></td><td width="37%"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><font color="#CC0000">';
echo stripslashes($row[1]);
echo '
</font>Price: £';
echo stripslashes($row[3]);
echo ".00
<a href=\"product_page.php?pid={$row[2]}\"><img src=\"images/moreinfo.gif\" width=\"167\" height=\"28\" border=\"0\"></td>";
}
As you can see from this, it is basically 2 columns with the same load of SQL Rows, which appears as little thumbnail with text next to it and in one row and the same in the row next to it.
Unfortunately this echo's the same information for both rows so while I have entered loads of different products they just appear as 2 below them. Can't work out how to solve this so all of the products are listed down the page in two's. Please if anybody can help me it'd be much appreatiated!
Thanks,
Neil
|