Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2007
    Location
    Ontario, Canada
    Posts
    27
    Plugin Contributions
    0

    Default 1064 Error in displaying MYSQL data after creating custom table

    Greetings. Tried to display a few fields in blank sidebox. Added new table in database and defined it in database_tables.php.
    It returned with the following error:

    Code:
    1064 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 '' . TABLE_NEW . ' ORDER by field1' at line 2
    in:
    [SELECT field1, field2' . TABLE_NEW . ' ORDER by field1]


    Currently running with PHP 5.2.5; MYSQL 4.1.22;

    Does this mean I need to upgrade MYSQL?

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: 1064 Error in displaying MYSQL data after creating custom table

    No, it's not a MySQL versioning issue. It's about declarations and syntax.

    Three issues to be dealt with:
    1. The table name hasn't been properly included in a "define" statement which is why it isn't getting resolved into a proper table name. You would normally include a statement in an extra_datafiles/your_datafile_name.php of the form define('TABLE_NEW', 'newtablename'); so that Zen Cart knows to which table TABLE_NEW refers
    2. You would need a space at the end of the string immediately before the constant is inserted to avoiud them running together when the constant is resolved
    3. You also need a "from" before the table name to indicate that you have finished your field list and are moving onto your tables
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Dec 2007
    Location
    Ontario, Canada
    Posts
    27
    Plugin Contributions
    0

    Default Re: 1064 Error in displaying MYSQL data after creating custom table

    Thank you. Will give it a try.

 

 

Similar Threads

  1. 1064 mysql error
    By m4rtyj in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 28 Mar 2010, 11:31 PM
  2. MySQL Error 1064 You have an error in your SQL syntax;
    By dmm2020 in forum General Questions
    Replies: 2
    Last Post: 22 Feb 2009, 05:02 AM
  3. Dreaded mYSQL 1064 error when importing MySQL 4 database into MySQL5
    By dml311071 in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 10 Jun 2008, 05:38 AM
  4. Replies: 1
    Last Post: 7 Jan 2007, 02:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg