Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbPress database error

  • @mazdakam

    Member

    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

Viewing 3 replies - 1 through 3 (of 3 total)
  • @mazdakam

    Member

    everything in front end is ok but in admin panel i have got that error for moderated post

    @_ck_

    Participant

    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.

    @_ck_

    Participant

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar