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

Login with username, password and session length
Members
Total Members: 10069
Latest: tetsujrock
Stats
Total Posts: 28682
Total Topics: 4975
Online Today: 94
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 43
Total: 43
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
0 Members and 2 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: SQL Syntax Error Help?!  (Read 2489 times)
Miyagi
Newbie
*
Offline Offline

Posts: 12


View Profile
« on: August 25, 2008, 07:03:35 am »

Hi,

Not the best SQL coder so really struggling to troubleshoot this.

Error:

Code:
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 'condition, value1, value2, ID_CONDITION
FROM smf_store_shippingconditions' at line 2
File: /home/fordxrtu/public_html/forum/Sources/Store.php
Line: 5524

Code:

Code:
5521:    $result = db_query("
5522:    SELECT
5523:    percent, totalamount, condition, value1, value2, ID_CONDITION
5524:    FROM {$db_prefix}store_shippingconditions", __FILE__, __LINE__);

SQL Version on my server: 5.0.51a-community

Thoughts on how to fix?

Thanks,
Miyagi
Logged
Miyagi
Newbie
*
Offline Offline

Posts: 12


View Profile
« Reply #1 on: August 25, 2008, 07:14:48 am »

2 seconds later... i think i've fixed it... the problem is condition is now a reserved word and needs to be 'condition'... can this be fixed properly in a new release to avoid future conflicts?
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9676


View Profile
« Reply #2 on: August 25, 2008, 07:27:09 am »

Yes it can be you can escape it with `condition` the back ticks should allow it to work.
Logged
Miyagi
Newbie
*
Offline Offline

Posts: 12


View Profile
« Reply #3 on: August 31, 2008, 04:03:55 am »

Still having intermittent issues with this error popping up across various parts of the shipping conditions so i dug deeper.

I'd suggest updating Store.Template.php in the package as follows:

REPLACE ON LINE 5669:
Code:
percent, totalamount, condition, value1, value2, ID_CONDITION

THIS:
Code:
percent, totalamount, 'condition', value1, value2, ID_CONDITION

Will help other members running store fix any potential issues.
« Last Edit: August 31, 2008, 04:12:04 am by Miyagi » Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9676


View Profile
« Reply #4 on: September 02, 2008, 08:06:08 pm »

Fixed that issue for SMF Store 1.3
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[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]

[May 17, 2012, 12:38:16 pm]

[May 15, 2012, 09:32:27 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 4.802 seconds with 18 queries.