Kill the googlebot
Posts: 6
48 credits Members referred : 0
« on: May 04, 2007, 11:44:46 am »
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
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: May 04, 2007, 11:47:19 am »
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
Kill the googlebot
Posts: 6
48 credits Members referred : 0
« Reply #2 on: May 04, 2007, 11:53:12 am »
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
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
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)
Kill the googlebot
Posts: 6
48 credits Members referred : 0
« Reply #4 on: May 04, 2007, 01:56:26 pm »
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
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #5 on: May 04, 2007, 10:15:12 pm »
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.
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6507