Skip to:

Opened 12 years ago

Closed 8 years ago

#4107 closed defect (bug) (worksforme)

WordPress database error for ”INSERT INTO ( blog_id, meta_key, meta_value ) VALUES”

Reported by: adrian7's profile adrian7 Owned by:
Milestone: Priority: normal
Severity: normal Version: 1.5.4
Component: Blogs Keywords:


I checked the php error_log file on my website and stubled across a lot or lines like this:

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 '( blog_id, meta_key, meta_value ) VALUES ( 2420, 'last_activity', '2012-03-29 22' at line 1 for query INSERT INTO  ( blog_id, meta_key, meta_value ) VALUES ( 2420, 'last_activity', '2012-03-29 22:02:16' ) made by require, require_once, require_once, require_once, do_action, call_user_func_array, maybe_add_existing_user_to_blog, add_existing_user_to_blog, add_user_to_blog, do_action, call_user_func_array, bp_blogs_add_user_to_blog, bp_blogs_record_blog, bp_blogs_update_blogmeta

I remebed I just added an existing user from the network to an existing blog.

I am still on 1.5.4, but it might affect the latest 1.5.5 version.

I guess the function responsible for this is bp_blogs_update_blogmeta where there's the queries.

$wpdb->prepare( "INSERT INTO {$bp->blogs->table_name_blogmeta} ( blog_id, meta_key, meta_value ) VALUES ( %d, %s, %s )", $blog_id, $meta_key, $meta_value ) 

And update respectively.

So it seems the var $bp->blogs->table_name_blogmeta is empty at that point.

Change History (3)

#1 @DJPaul
12 years ago

  • Keywords dev-feedback 2nd-opinion removed
  • Milestone changed from Awaiting Review to Future Release
  • Severity changed from major to normal

Do you have the Blogs component (site tracking) enabled on this site?

#2 @adrian7
12 years ago

Yes. Activated.

Well the user was added to the blog, with the role asssigned. But errors shows something got the wrong way...

Last edited 12 years ago by adrian7 (previous) (diff)

#3 @DJPaul
8 years ago

  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed

We don't have this problem any more. I assume it was fixed in the last few years somewhere.

Note: See TracTickets for help on using tickets.