I manage to get the data result from the query in one big jumble at the top of my results page - but not in the table that I thought I was placing it in. Here's the code:
Code: Select all
<?php
function ShowCart()
{
$hostname = 'localhost';
$username ='abc';
$password ='123;
$dbName = 'mydb_db';
MYSQL_CONNECT($hostname, $username, $password) OR DIE("Unable to connect");
@MYSQL_SELECT_DB("$dbName") OR DIE("Unable to select database");
$result = mysql_query("SELECT * FROM cart INNER JOIN pieces ON cart.piecenum=pieces.piecenum WHERE cookieID='" . GetCartId() . "'") or die(mysql_error());
error_reporting (E_ALL ^ E_NOTICE);
while($row = mysql_fetch_array($result))
{?>
<tr>
<td width="15%" height="25"></td>
<td width="55%" height="25"><?php echo $row['description']; ?></td>
<td width="20%" height="25"><?php echo $row['price']; ?></td>
<td width="10%" height="25"></td>
</tr>
?>Can someone please help?