Support » Plugin: Auto Post Thumbnail » Fix for SQL syntax error

  • Armin Rosu

    (@armin_san)


    If you are getting this error:

    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 's nine o'clock" src="...

    That is because you have an attribute other than src following img. E.g.: <img alt="Something" src="http://logo.gif" />

    To fix this, change _wp-content/plugins/auto-post-thumbnail/auto-post-thumbnail.php_ line 291 to foreach ($matches[1] as $key => $image) {

    and remove or comment out line 303: // $image = substr($image, strpos($image, '"')+1);

    The bug is caused by 2 issues:

    * not looking for the src tag but the first tag after <img
    * not sanitizing the SQL query for '

  • The topic ‘Fix for SQL syntax error’ is closed to new replies.