28, August 2008

Empty rows on EXIT - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ 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

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


« on: Sep 14, 2006, 08: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: 6301
38632 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Sep 14, 2006, 08: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...


Last blog : Is your website is down? Know before your visitors do!
Kill the googlebot
*
Posts: 6
40 credits
Members referred : 0


« Reply #2 on: Sep 14, 2006, 10: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: 6301
38632 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Sep 14, 2006, 11: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);
}



Last blog : Is your website is down? Know before your visitors do!
Kill the googlebot
*
Posts: 6
40 credits
Members referred : 0


« Reply #4 on: Sep 14, 2006, 11: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: 6301
38632 credits
Members referred : 374


It's time to use PHP5!


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

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...


Last blog : Is your website is down? Know before your visitors do!
Kill the googlebot
*
Posts: 6
40 credits
Members referred : 0


« Reply #6 on: Sep 14, 2006, 05: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, 05:54:02 PM by bavo »
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6301
38632 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Sep 14, 2006, 10: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)


Last blog : Is your website is down? Know before your visitors do!
Kill the googlebot
*
Posts: 6
40 credits
Members referred : 0


« Reply #8 on: Sep 14, 2006, 11: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: 6301
38632 credits
Members referred : 374


It's time to use PHP5!


« Reply #9 on: Sep 14, 2006, 11: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!


Last blog : Is your website is down? Know before your visitors do!
Kill the googlebot
*
Posts: 6
40 credits
Members referred : 0


« Reply #10 on: Sep 14, 2006, 11: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....

Topic sponsors:
Get a permanent link here for $1.99!


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?
Aug 28, 2008, 11:24:29 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!


Forum Statistics
Total Posts: 36.161
Total Topics: 7.461
Total Members: 3.855
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: givvig

40 Guests, 5 Users online :

17 users online today:



Readers

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