[Resolved] $wpdb->prepare error
prepareexpects an additional argument, so it issues a warning for line 18 of
function etivite_bp_pending_activations_users_count(). It doesn’t look like you need
prepareanyway (since the query isn’t using any variables), so I’ve updated the statement to
$count = $wpdb->get_var( "SELECT COUNT(u.ID) FROM $wpdb->usermeta m1, $wpdb->users u WHERE u.ID = m1.user_id AND u.user_status = 2 AND m1.meta_key = 'activation_key' ORDER BY u.user_registered ASC" );
It works fine for me on two test installations.
- The topic ‘[Resolved] $wpdb->prepare error’ is closed to new replies.