here is my code that i am having trouble with.
<?php
// Get a connection to the database
$cxn = @ConnectToDb($dbServer, $dbUser, $dbPass, $dbName);
$result = mysql_query("SELECT * FROM submitorder");
?>
<?php
while($row = mysql_fetch_array($result))
{
$orderId=$row["orderId"];
$orderName=$row["orderName"];
$ordercookieid=$row["cookieid"];
?>
<?php echo $row["orderName"]; ?>
<?php
$orderdetails = mysql_fetch_assoc(mysql_query("SELECT * FROM cart WHERE cookieID = '$result[cookieID]'"));
while ($orderdetails = mysql_fetch_assoc($orderdetails)) {
$itemdetails = mysql_fetch_assoc(mysql_query("SELECT * FROM items WHERE itemID = '$ordersdetails[itemID]'"));
echo $orderdetails['qty'] .' X ' $itemdetails['itemname'] .' At ' . $itemdetails['itemprice'] . '<p>';
}
?>
I get this: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/virtual/site482/fst/var/www/html/orderstest.php on line 74 (which is this line while ($orderdetails = mysql_fetch_assoc($orderdetails)) {
)
Thanks for your help.