class problem...again:-(

From: Date: Fri, 17 Nov 2000 07:48:48 +0000
Subject: class problem...again:-(
Groups: php.general 
Request: Send a blank email to php-general+get-25876@lists.php.net to get a copy of this message
hey all... i have a shopping cart and wish to display the contents of the cart. i do this via the function below... 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; } i don't get any error messages...it just dosen't display anything.....i call it like this.... if ($action == "display"){ $disp = $cart->display_contents(shopping, $session); echo $contents[items]; } what am i doing wrong? ~kurth Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer There is no sin except stupidity. -- Oscar Wilde kurth@usaexpress.net | http://www.usaexpress.net/kurth PGP key available - http://www.usaexpress.net/kurth/pgp Fight Weak Encryption! Donate your wasted CPU cycles to Distributed.net (http://www.distributed.net)

« previous php.general (#25876) next »