SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
May 24, 2012, 01:53:33 pm

Login with username, password and session length
Members
Total Members: 10071
Latest: cdavidson012
Stats
Total Posts: 28687
Total Topics: 4977
Online Today: 94
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 1
Guests: 58
Total: 59
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
0 Members and 2 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Database cart limit querie error  (Read 3049 times)
~ Phåråoh ~
SMF Gallery Pro Customer
Jr. Member
*****
Offline Offline

Posts: 63



View Profile WWW
« on: August 16, 2009, 09:16:32 pm »

smf v2.0 RC1.2

I added an item which only allows a quantity of 1 to be purchased and started getting this error repeatedly:

Type of error: Database  
http://www.classicwinnebagos.com/forum/index.php?http://www.classicwinnebagos.com/forum/storeipn2.php  
Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 4
File: public_html/forum/storeipn2.php
Line: 237  

Code:
StoreDebugLog('Begin query:' . "SELECT
ID_ITEM, ID_CART, ID_MEMBER, date, quantity
FROM {db_prefix}store_CART
WHERE ID_CART = $id_cart LIMIT 1");

$cartResult = $smcFunc['db_query']('', "
SELECT
ID_ITEM, ID_CART, ID_MEMBER, date, quantity
FROM {db_prefix}store_cart
WHERE ID_CART = $id_cart LIMIT 1");
$cartRow = $smcFunc['db_fetch_assoc']($cartResult);
$smcFunc['db_free_result']($cartResult);


Line 273 =  WHERE ID_CART = $id_cart LIMIT 1");


Database queries are waaaaaaay out of my knowledge base... Thanks!




« Last Edit: August 23, 2009, 07:07:40 pm by ~ Phåråoh ~ » Logged

"So let it be written; so let it be done!"
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #1 on: August 16, 2009, 10:21:35 pm »

Do you have the shopping cart enabled on your store? Or selling single items only?
Logged
~ Phåråoh ~
SMF Gallery Pro Customer
Jr. Member
*****
Offline Offline

Posts: 63



View Profile WWW
« Reply #2 on: August 16, 2009, 10:57:57 pm »

Shopping cart was always enabled.
Logged

"So let it be written; so let it be done!"
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #3 on: August 17, 2009, 08:32:48 pm »

That item does appear in the shopping cart and you click on add to a cart to checkout correct?


I did a test product with a price of $10 and nothing else changed
"Can have Quantity " is not checked

Is this the exact same settings you have on your item?
Logged
~ Phåråoh ~
SMF Gallery Pro Customer
Jr. Member
*****
Offline Offline

Posts: 63



View Profile WWW
« Reply #4 on: August 18, 2009, 09:44:19 am »

All above conditions are the same.  Other than actual products for sale with on-hand quantities, I have 1 item which is a are download and one which is a subscription.  

I tested both of those items.  All are added to the shopping cart and I know the purchase process works because two subscriptions have been purchased and 2 downloads as well.  The error does not occur during this process.  I cleared the lerror og, went through the point of adding to shopping cart and it generated no errors.

Can have qty is not checked on these items. 

There is one item which has a "low quatity" stock of 1.  I disabled the low stock quantitiy notification, temporarily, just to stop the errors from piling up in my error log, until the syntax of the database querie is reviewed, since that's what the error is explicity indicating as the cause.
« Last Edit: August 18, 2009, 06:02:58 pm by ~ Phåråoh ~ » Logged

"So let it be written; so let it be done!"
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #5 on: August 18, 2009, 06:45:56 pm »

The only time you would see errors from
http://www.classicwinnebagos.com/forum/storeipn2.php
Is if a purchase was made.

If you click on that link it may result in errors being generated because no cart id is passed. If the orders are working correctly it would be safe to ignore for now I can later add some code to check for empty card id and not do anything.
Logged
~ Phåråoh ~
SMF Gallery Pro Customer
Jr. Member
*****
Offline Offline

Posts: 63



View Profile WWW
« Reply #6 on: August 18, 2009, 09:31:22 pm »

I've been checking the purchases, and no new ones have been made.  Certainly not enough to generate a dozen errors a day.  I'm also wondering if the people trying to, can't for some reason.

This evening, I got 4 store email notifications:

INVALID
 cmd=_notify-validate

It's almost like the thing is deteriorating or something.  I think I'm going to uninstall and re-install the store program.


UPDATE:  Well, that was a bad idea.  Went to uninstall in reverse order of 1.3.4 and got a TON of uninstall errors.  I noticed that the 1.3.3 line in the package manager had [upgrade] next to it.  So, I did that.  Then I saw [upgrade] next to 1.3.4.  The last purchase through the store was on Aug 16th, at which time, all the initial errors were already ocurring.  At least I knew it wasn't preventing sales.  However, this new Email really concerns me.

I did a "real life" purchase and it all went through fine.  So, at least I know that works.  Nonetheless, this is a total nuisance and needs to be dealt with. 

I appreciate your continuing support.  I understand you have a lot of support issues to resolve in order to restore the functionality to other client's accounts.  I will be patient.  I just ask that you not forget about it.

Thanks again.
 
« Last Edit: August 18, 2009, 10:03:27 pm by ~ Phåråoh ~ » Logged

"So let it be written; so let it be done!"
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #7 on: August 19, 2009, 08:50:06 pm »

Will check it out this weekend for a fix. Should be simple to change just adding an extra validation check I believe for th cart passed.
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #8 on: August 22, 2009, 07:21:26 pm »

Fixed for 1.3.5
Logged
~ Phåråoh ~
SMF Gallery Pro Customer
Jr. Member
*****
Offline Offline

Posts: 63



View Profile WWW
« Reply #9 on: August 23, 2009, 07:10:55 pm »

Tested and verified.  Thanks!
Logged

"So let it be written; so let it be done!"
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[Today at 08:02:50 am]

[Today at 04:11:41 am]

[May 21, 2012, 08:54:11 am]

[May 20, 2012, 11:06:52 am]

[May 20, 2012, 05:58:11 am]

[May 19, 2012, 06:16:58 pm]

[May 19, 2012, 05:42:37 pm]

[May 18, 2012, 03:08:38 pm]

[May 17, 2012, 06:07:46 pm]

[May 17, 2012, 02:22:07 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.16 | SMF © 2006-2011, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 0.484 seconds with 17 queries.