Re: At last an error message!
| From: | Pekka Saarinen | Date: | Thu, 31 Oct 2002 13:28:59 +0000 |
| Subject: | Re: At last an error message! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122250@lists.php.net to get a copy of this message | ||
At 10/31/2002, you wrote:
function get_order_id_receipt($orderid, $shipping) { //Get order ID from DB to pass to receipt. $conn = db_connect(); $datequery = "select date from receipts where customerid = '10'"; $query = "select orderid from receipts where customerid = '10'"; $shippingquery = "select shipping from receipts where customerid = '10'"; $date_result = mysql_query($datequery); $date = mysql_result($date_result); $orderid_result = mysql_query($query); $orderid = mysql_result($orderid_result); $shipping_result = mysql_query($shippingquery); $shipping = mysql_result($shipping_result); return $orderid; return $shipping; } I get these errors echoed from mysql_error() Warning: Wrong parameter count for mysql_result() in order_fns.php on line 127 Warning: Wrong parameter count for mysql_result() in order_fns.php on line 129 Warning: Wrong parameter count for mysql_result() in order_fns.php on line 131 What does that mean?Try function get_order_id_receipt($orderid, $shipping) { //Get order ID from DB to pass to receipt. $conn = db_connect(); $datequery = "select date from receipts where customerid = '10'"; $query = "select orderid from receipts where customerid = '10'"; $shippingquery = "select shipping from receipts where customerid = '10'"; $date_result = mysql_query($datequery); $date = mysql_result($date_result,0); $orderid_result = mysql_query($query); $orderid = mysql_result($orderid_result,0); $shipping_result = mysql_query($shippingquery); $shipping = mysql_result($shipping_result,0); return $orderid; return $shipping; } See http://fi2.php.net/manual/fi/function.mysql-result.php But with mysql_result you'll get see one CELL only. Maybe you need to use something like $dates = array(); while ($row = mysql_fetch_array( $date_result)) { array_push($dates, $row["date"]); } return $dates; ------------------------- Pekka Saarinen http://photography-on-the.net -------------------------