Forums

[Plugin: GD Press Tools] timestampdiff MySQL error for delayed RSS feeds (4 posts)

  1. ballinascreen
    Member
    Posted 2 years ago #

    I've just been taking a look at my server log files recently and noticed a number of recurring MySQL error messages such as the one below:

    WordPress 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 ''minute', wp_posts.post_date_gmt, '2010-03-14 23:04:26') > 5 ORDER BY wp_' at line 1 for query SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') and timestampdiff('minute', wp_posts.post_date_gmt, '2010-03-14 23:04:26') > 5 ORDER BY wp_posts.post_date DESC LIMIT 0, 10 made by require, wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts

    Searching through my plugins, the only one which makes use of the timestampdiff function was the excellent GD Press Tools as part of the code to add a delay to the publication of posts in RSS feeds - from what I gather, the first parameter to this function should use the reserved word MINUTE (or WEEK/MONTH/YEARetc) rather than a string 'minute'. I'm currently using GD Press Tools 2.4.0 and the error occurs on line 561 of gd-press-tools.php. I've manually corrected this in my installation and the error message no longer appears in my server logs.

    http://wordpress.org/extend/plugins/gd-press-tools/

  2. Milan Petrovic
    Member
    Posted 2 years ago #

    This is most likely some kind of mySQL incompatibility. What version of mySQL you are using?

  3. ballinascreen
    Member
    Posted 2 years ago #

    MySQL: 5.0.88-userstats-log
    PHP: 5.2.9

  4. Milan Petrovic
    Member
    Posted 2 years ago #

    OK, I will check it again.

Topic Closed

This topic has been closed to new replies.

About this Topic