$vote_count = $wpdb->get_var($wpdb->prepare("SELECT votes FROM wp_mytable WHERE product = %s AND
company = %s", $product, $company));
if(is_int($vote_count)){
$html = \'<a href="#" class="vote_for_doc">
Vote here</a> (<span class="vote-count">\' . $vote_count . \'</span> Votes for \' . $product . \' and \' . $company . \')\';
}else{
if(is_string($vote_count)){
$html = \'$vote_count is a string in the database<p>\' . print_r($vote_count);
}if(is_array($vote_count)){
$html = \'$vote_count is an array in the database<p>\' . print_r($vote_count);
}else{
$html = \'$vote_count is not a string or an integer<p>\' . print_r($vote_count);
}
}
和我的输出:
$vote\\u count不是字符串或整数
1.