我这样做的方式有什么问题吗,因为我清空了数据库表来测试这段代码,它为 $cc_rows 返回了一个值“1”......
$ccquerycount = "SELECT COUNT(*) FROM payments_cc_info WHERE user_id=$userid";
$ccresult = mysql_query($ccquerycount) or die(mysql_error());
$cc_rows = mysql_num_rows($ccresult);
echo $cc_rows;
if ($cc_rows > 0) {
echo '<div class="message_success" align="center">Credit Card info on file.<br />Edit settings to change.</div>';
} else {
echo '<div class="message_error" align="center">No Credit Card info on file.<br />Edit settings to change.</div>';
}