chris_middleton
Fri 4 May 2007, 11:44 am GMT +0200
when using your cart i seem to get this error:
Warning: sprintf() [function.sprintf]: Too few arguments in /home/chris/public_html/rock/classes/db_cart/db_cart_class.php on line 92
function remove_old_orders($remove_only_zeros = true) {
if (RECOVER_ORDER) {
LINE 92---> $sql = sprintf("DELETE FROM %s WHERE open = 'y' AND order_date < (NOW() - %d)", ORDERS, VALID_UNTIL * 86400);
} else {
$sql = sprintf("DELETE FROM %s WHERE open = 'y' AND customer = %d AND order_date < (NOW() - %d)", ORDERS, VALID_UNTIL * 86400);
}
$sql .= ($remove_only_zeros) ? " AND customer = 0" : "";
mysql_query($sql);
}
Any help welcomed.
Chris M
olaf
Fri 4 May 2007, 11:47 am GMT +0200
not that row, here is a bug:
$sql = sprintf("DELETE FROM %s WHERE open = 'y' AND customer = %d AND order_date < (NOW() - %d)", ORDERS, VALID_UNTIL * 86400);
there must the customer number between ORDERS and VALID_UNTIL * 86400
chris_middleton
Fri 4 May 2007, 11:53 am GMT +0200
i'm not sure i understand, i have chanegd that line so it now calls the customer_no variable and looks like this:
ORDERS, customer_no, VALID_UNTIL * 86400);
but now i get the following error:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/chris/public_html/rock/classes/db_cart/db_cart_checkout_stock_example.php on line 82
olaf
Fri 4 May 2007, 11:57 am GMT +0200
i'm not sure i understand, i have chanegd that line so it now calls the customer_no variable and looks like this:
ORDERS, customer_no, VALID_UNTIL * 86400);
but now i get the following error:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/chris/public_html/rock/classes/db_cart/db_cart_checkout_stock_example.php on line 82
this is wrong: "customer_no"
check the script for the right var name (could not be so hard to find)
chris_middleton
Fri 4 May 2007, 01:56 pm GMT +0200
first off sorry for all the posts, but am having problems when updating the order quantity. Once im at the checkout, if i enter 0 as my qunatity and then update i get this error:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/chris/public_html/rock/classes/db_cart/db_cart_checkout_stock_example.php on line 82
Thanks,
Chris M
olaf
Fri 4 May 2007, 10:15 pm GMT +0200
don't worry about the questions ;)
this query is only related to your product/stock value database:
$query_stock = sprintf("SELECT art_no, amount AS on_stock FROM db_cart_stock_article_example WHERE art_no IN (%s) ORDER BY art_no", $search_in);
this will work only with the included database. Look the cart class is not stand alone, you need at last am existing product catalog and maybe a customer database.