尝试编写一个有效的prepare语句。这项工作:
$countthem = $wpdb->get_var( "SELECT COUNT(*) FROM wp_cmapg WHERE lang = \'yes\'" );
这不起作用:
$countthem = $wpdb->get_var(
$wpdb->prepare( "SELECT COUNT(*) FROM wp_cmapg WHERE lang= %s", $lang ), 0, 0
);
还尝试了:
$countthem = $wpdb->get_var(
$wpdb->prepare( "SELECT COUNT(*) FROM wp_cmapg WHERE lang LIKE %%%s%%", $lang ), 0, 0
);
的内容
$lang
是的,是的。