Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 191
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 217
Total: 217

Author Topic: SQL Syntax Error Help?!  (Read 32111 times)

0 Members and 1 Guest are viewing this topic.

Offline Miyagi

  • Member
  • *
  • Posts: 12
    • View Profile
SQL Syntax Error Help?!
« on: August 25, 2008, 07:03:35 am »
Hi,

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

Error:

Code: [Select]
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: [Select]
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

Offline Miyagi

  • Member
  • *
  • Posts: 12
    • View Profile
Re: SQL Syntax Error Help?!
« 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?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: SQL Syntax Error Help?!
« 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.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Miyagi

  • Member
  • *
  • Posts: 12
    • View Profile
Re: SQL Syntax Error Help?!
« 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: [Select]
percent, totalamount, condition, value1, value2, ID_CONDITION

THIS:
Code: [Select]
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 »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: SQL Syntax Error Help?!
« Reply #4 on: September 02, 2008, 08:06:08 pm »
Fixed that issue for SMF Store 1.3
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
11610 Views
Last post February 09, 2008, 11:44:03 pm
by ApplianceJunk
2 Replies
7924 Views
Last post January 24, 2009, 09:28:41 am
by cepsi
1 Replies
4043 Views
Last post April 02, 2009, 09:06:46 pm
by SMFHacks
1 Replies
2634 Views
Last post June 17, 2012, 11:30:06 am
by SMFHacks
16 Replies
20116 Views
Last post October 03, 2017, 08:49:37 pm
by drewactual

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

Powered by EzPortal