Anything wrong with this function?

From: Date: Thu, 31 Oct 2002 08:45:25 +0000
Subject: Anything wrong with this function?
Groups: php.general 
Request: Send a blank email to php-general+get-122215@lists.php.net to get a copy of this message
Can anyone see why I am having problems with this page. I'm trying to connect to the DB and display results using the function get_order_id_receipt. The DB connection works because I can produce the cart based on the users session so I don't get why this doesn't work.... <? include ('products_fns.php'); include ('order_fns.php'); include ('db_fns.php'); include ('output_fns.php'); // The shopping cart needs sessions, so start one session_start(); do_html_header("Please print out this page for your records."); function get_order_id_receipt($orderid, $shipping) { //Get order ID from DB to pass to receipt. $conn = db_connect(); $query = "select orderid from receipts"; $shippingquery = "select shipping from receipts"; $orderid = mysql_result($query); $shipping = mysql_result($shippingquery); //return $orderid; } //debug test echo mysql_error(); echo "test & $orderid"; echo "test & $shipping"; display_receipt($orderid); echo "<table width='760' cellpadding='0' background='images/shopbg.gif'><tr><td>&nbsp;</td></tr></table>"; display_cart($cart, false, 0); echo "<table width='760' cellpadding='0' background='images/shopbg.gif'><tr><td>&nbsp;</td></tr></table>"; echo "<table width='760' cellpadding='0' background='images/shopbg.gif'><tr><td>&nbsp;</td></tr></table>"; display_success_form(); //empty shopping cart //session_destroy(); do_html_footer(); ?> Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com <http://www.violasystems.com/> stephen.jackson@violasystems.com Mobile +358 50 343 5159

« previous php.general (#122215) next »