Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2009
    Posts
    3

    Unanswered: MYSQL + WP woes help appreciated.

    Hi, and thanks for looking.

    This tiny piece of code is driving me absolutely nuts.
    The error reported by the http server log is:

    #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 'made by require, require_once, include, get_header, locate_template, load_templa' at line 1

    The query is as follows:

    Code:
    SELECT * FROM `wp_eventscalendar_main` WHERE `eventStartDate` >= '2009-06-28' OR `eventEndDate` >= '2009-06-28' ORDER BY `eventStartDate`, `eventStartTime` LIMIT made by require, require_once, include, get_header, locate_template, load_template, require_once, dynamic_sidebar, call_user_func_array, "WidgetCache->widget_cache_redirected_callback", call_user_func_array, "EC_Widget->display", "EC_Calendar->displayEventList", "EC_DB->getUpcomingEvents"
    I have tried everything I can think of including ';' after LIMIT, specifying specific numbers and ranges with and without comment delimeters after...

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    what do you think or expect the
    Code:
    made by require, require_once, include, get_header, locate_template, load_template, require_once, dynamic_sidebar, call_user_func_array, "WidgetCache->widget_cache_redirected_callback", call_user_func_array, "EC_Widget->display", "EC_Calendar->displayEventList", "EC_DB->getUpcomingEvents"
    is all about
    Ive never seen anythign like that in any SQL engine
    I'd suggest you have a good look at the help for then MySQL version you are using for details on the limit clause
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2009
    Posts
    3
    The first part of the query is fine up and and including the LIMIT clause. If a figure or range is left off from LIMIT the server automagically appends 0, 30 as a range.

    After the limit query are a bunch of what appear to be UDF's or custom functions called from PHP script.

    A google search for "LIMIT made by require, require_once," will show numerous instances of this snippet of code.. I'm just not sure why it's borking for me.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by CinqueXX
    I'm just not sure why it's borking for me.
    i can tell you why

    because it's invalid syntax, that's why
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jun 2009
    Posts
    3
    I can totally accept that. I only question why it apparently works for so many others.

    Thanks all the same.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I'd suggest you ask that question of the others...
    it wont work in MySQL, so I'm mystified as to how it allegedly works for others

    thats why I suggest you look at da manuel
    run your queries in say MySQl query browser to prove they work before putting the query in code. that way round you will know whether its your sql, your code or possibly something else. if you don't validate your own code and sql it makes it tough for you and others to diagnose where problems lie.

    but the again the words after the limit look more like a ragbag of PHP functions as if the code has been sloppily cut & paste/lifted from a PHP site.
    Last edited by healdem; 06-29-09 at 07:38.
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by CinqueXX
    I only question why it apparently works for so many others.
    it doesn't

    just like you, i googled it, and the few examples i looked at were all by people either posting questions to get help for the error it caused, or it was an apparently automatic display of a failing query in Wordpress
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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