28, May 2012

Empty rows on EXIT - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  DB_cart Class (Moderator: Olaf)
Topic: Empty rows on EXIT
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: Empty rows on EXIT  (Read 3003 times)
Kill the googlebot
*
Posts: 6
40 credits
Members referred : 0


« on: Sep 14, 2006, 07:45:37 am »

Hi Olaf,

I'am succesfully using your db_class for my shoppingcart. I have one problem:
When a user fills his shopping cart (i use the cart with NO customerstable) and then exits the browser without deleting or bying the order a empty trace exists in the database tables. How ca i resolve that problem ??
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Sep 14, 2006, 07:49:02 am »

the only way to do this is that the user has to login first, without customer information there is no chance. The class is using a database and not cookies...

Kill the googlebot
*
Posts: 6
40 credits
Members referred : 0


« Reply #2 on: Sep 14, 2006, 09:14:19 am »

Yes i know that, but i mean the order tables. Also when i use random customnumbers as if there was a customer the order rows, order and shipment table are left half filled when i exit the browser.
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Sep 14, 2006, 10:00:43 am »

Yes i know that, but i mean the order tables. Also when i use random customnumbers as if there was a customer the order rows, order and shipment table are left half filled when i exit the browser.

there is this kind of function (don't see the problem)

Code:
<?php
function 
remove_old_orders($customer$remove_only_zeros true) {
if (RECOVER_ORDER && $customer 0) {
$sql sprintf("DELETE FROM %s WHERE open = 'y' AND customer = %d AND order_date < (NOW() - %d)"ORDERS$customerVALID_UNTIL 86400);
} else {
$sql sprintf("DELETE FROM %s WHERE open = 'y' AND order_date < (NOW() - %d)"ORDERSVALID_UNTIL 86400);
}
$sql .= ($remove_only_zeros) ? " AND customer = 0" "";
mysql_query($sql);
}


Kill the googlebot
*
Posts: 6
40 credits
Members referred : 0


« Reply #4 on: Sep 14, 2006, 10:26:54 am »

Ok i've seen that function, do suggest i call it on exit of the browser ??

How do you use this class without customers anyway ? i mean how did you designed it. Do you use customer =0 everywhere are something else ??
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Sep 14, 2006, 11:12:11 am »

Quote
Ok i've seen that function, do suggest i call it on exit of the browser ??

you don't need to it's based on the customer ID (zero)

Quote
How do you use this class without customers anyway ? i mean how did you designed it. Do you use customer =0 everywhere are something else ??

if you use a "0" in place of a customer number everything has to work fine...

Kill the googlebot
*
Posts: 6
40 credits
Members referred : 0


« Reply #6 on: Sep 14, 2006, 04:42:29 pm »

Greate, now i discovered my problem. In your class you call remove_old_orders after get_order. Now when i use customer as 0 the remove_old_orders delete's the new order again. Thats also whats leaving the empty records in the database. If i comment out the remove fun tion it works fine.

By the way, is there a good reason why you don't remove the rows and shipment record that belong to the "old" order ??
« Last Edit: Sep 14, 2006, 04:54:02 pm by bavo »
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Sep 14, 2006, 09:55:39 pm »


By the way, is there a good reason why you don't remove the rows and shipment record that belong to the "old" order ??

yes I saw this today, normally they have to be removed too...Will change this (soon)

Kill the googlebot
*
Posts: 6
40 credits
Members referred : 0


« Reply #8 on: Sep 14, 2006, 10:06:50 pm »

OK that good news.

Everything works fine now. Good site and wel though of solutions for problems we all have.

Thank you
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #9 on: Sep 14, 2006, 10:23:10 pm »

OK that good news.

Everything works fine now. Good site and wel though of solutions for problems we all have.

Thank you

You're welcome, the reason why I started my own projects was: having some easy to use tools!

Kill the googlebot
*
Posts: 6
40 credits
Members referred : 0


« Reply #10 on: Sep 14, 2006, 10:25:11 pm »

And they are ... Smiley
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=4091
Tags : databases cookies browsers Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  DB_cart Class (Moderator: Olaf)
Topic: Empty rows on EXIT
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 02:16:43 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.