MySQL syntax error – incorrect post ID determination?
-
I’m getting the following errors several times every time I save a post:
[12-Feb-2011 06:23:33] 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 ” at line 1 for query select post_content from wp_posts where id= made by do_action_ref_array, call_user_func_array, do_all_pings, do_trackbacks, apply_filters, call_user_func_array, tfe_put_image
Possible explanation:
The function tfe_put_image() uses $wp_query->post->ID to determine the post ID and this seems not to be working. My understanding is that within “the loop”, the post ID can either be determined by the_ID() function or by declaring $post global and using $post->ID.
Somehow, thumbnails still show up, but making this query seems unnecessary when has_post_thumbnail() is available, so tfe_put_image() could possibly be rewritten to perform better as well as run correct SQL.
- The topic ‘MySQL syntax error – incorrect post ID determination?’ is closed to new replies.