Calculate occurrences of text word in postmeta meta_value
-
I’ve been trying so many different ways of counting how many times a word or value is used in a postmeta meta_value string. For example say this is my meta_value
a:1:{s:3:"d";a:2:{i:0;a:7:{s:9:"super_m";s:10:"superv";s:6:"m";s:1:"4";s:7:"ap";s:2:"PM";s:6:"M";s:2:"10";s:7:"time_AP";s:2:"PM";s:8:"super_m";s:55:"cmp";s:7:"m";s:1:"1";}i:1;a:2:{s:8:"indetail";s:2:"dd";s:7:"m";s:1:"1";}}}
“super_m” is in there 2 times. How do I go about counting them?
Where do I go with this. I’ve tried so many variations..
$test_count = $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->postmeta ???;”);
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘Calculate occurrences of text word in postmeta meta_value’ is closed to new replies.