bbPress 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 'AND meta_key='views'' at line 1]
SELECT meta_value FROM bb_topicmeta WHERE topic_id = AND meta_key='views
bbPress support forums » Troubleshooting
bbPress database error
(4 posts)-
Posted 1 year ago #
-
everything in front end is ok but in admin panel i have got that error for moderated post
Posted 1 year ago # -
I haven't seen the bb-topic-views author around, well ever, but apparently it's been two months or so.
Unfortunately I can't reproduce the error or I'd try to help.
Posted 1 year ago # -
Ah I know what it is after studying the code a bit.
They never planned on $topic_id being null or not set, so it's being inserted into the query as blank.mysql is getting something like
SELECT meta_value FROM $bbdb->topicmeta WHERE topic_id = AND meta_key='views'
see the blank before AND? It's unacceptable to mysql, needs to be a value.hack
function get_view_count ( $topic_id )
and
function initialize_view_count( $topic_id )and make a new first line for each that says
if (!$topic_id) return;Should be a dirty workaround until the author can take a look.
Posted 1 year ago #
Reply
You must log in to post.