PHP Scripting Forums » PHP Classes Support Forum » Db_cart class Support forum

[sticky]

Using DB cart without a customer ID

(15 posts)
Great offers not only for geeks!
Your Ad Here

  1. locate inside the class file this function: function get_order($customer)

    and add and "echo" before this row:

    $sql_new = sprintf("INSERT INTO %s (customer, order_date) VALUES (%d, NOW())", ORDERS, $customer);

    test this query in phpmyadmin too

    Posted 9 months ago #
  2. User has not uploaded an avatar

    xkarlos
    Member

    I think I have the reason of these problems:
    it is this SQL command:

    DELETE FROM db_cart_orders WHERE open = 'y' AND order_date < (NOW() - 715112448) AND customer = 0 )

    every time I check the page 2 this script is run and delete the orders,
    which are opened too. I think something is wrong with the date.

    if I comment this SQL command it seems to work correctly.

    what do you think about it ?

    Posted 9 months ago #
  3. do you hard coded the time value?

    what do you use in the db_config file?

    default is:

    define("VALID_UNTIL", 7 * 86400); // 7 days

    you value is about today-8276 days

    try the default value again

    Posted 9 months ago #
  4. User has not uploaded an avatar

    xkarlos
    Member

    I have the default value :
    define("VALID_UNTIL", 7 * 86400);

    But in the SQL there is * 86400 again. is this correct ?

    sprintf("DELETE FROM %s WHERE open = 'y' AND order_date < (NOW() - %d)", ORDERS, VALID_UNTIL * 86400);

    Posted 9 months ago #
  5. sorry can't follow you... what you have posted before is wrong (post 389)

    Posted 9 months ago #

RSS feed for this topic

Reply

You must log in to post.