Count posts with meta_key LIKE
-
Hello,
this is my query:
$test_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key LIKE '%salon%'", $meta_key));
I have many posts with meta_key “salon_irc” and “salon_jabber”, so, my query count only the posts with “salon_jabber” meta_key ?? why?
bye
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Count posts with meta_key LIKE’ is closed to new replies.