Info
- 4 posts
- 2 voices
- Started 4 years ago by mazdakam
- Latest reply from _ck_
- This topic is not resolved
bbPress database error
-
- Posted 4 years ago #
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 -
- Posted 4 years ago #
everything in front end is ok but in admin panel i have got that error for moderated post
-
- Posted 4 years 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 4 years 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.
-
You must log in to post.