function not working?
| From: | Kurth Bemis | Date: | Wed, 28 Feb 2001 07:26:31 +0000 |
| Subject: | function not working? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-41958@lists.php.net to get a copy of this message | ||
i can't get his function to work. i pass the correct data to it...but no results....
heres the function
function display_contents($table,$session)
{
$count = 0;
$result = mysql_query( "SELECT * FROM $table WHERE session='$session'");
while($row = mysql_fetch_array($result)){
$result_inv = mysql_query( "SELECT * FROM retailseafood WHERE pid='$row[items]'");
$row_inventory = mysql_fetch_array($result_inv);
$contents[ "items"][$count] = $row_inventory[pid];
$contents[ "price"][$count] = $row_inventory[price];
//$contents[ "quantity"][$count] = $row[quantity];
$contents[ "total"][$count] = ($row_inventory[price] * $row[quantity]);
$count ++;
}
$total = $this->cart_total($table,$session);
$contents[ "final"] = $total;
return $contents;
}
// return number of items in cart
and heres what i do to call the function
<A href="cart.php?action=display">View Contents Of Cart</A>
what or where am i doing/going wrong?
~kurth