<?php
$query="select * from record where uid=".$_SESSION['uid']." order by service_date DESC";
@$result=$db->query($query);
if($mysqli_num_rows($result)<1)
{
echo "暂无消费记录";
}
else
{
$num=mysqli_num_rows($result);
for($i=0;$i<$num && $i<=10;$i++)
程序大概就是这样,提示出错
Fatal error: Function name must be a string in main.php on line 52
第52行就是if($mysqli_num_rows($result)<1)难道是不能在
@$result=$db->query($query);这里加上@?请赐教

解决方案 »

  1.   

    if少了个括号。尴尬,eclipse居然没提示
      

  2.   

    if($mysqli_num_rows($result)<1)这里多了个$符号。
      

  3.   

    $mysqli_num_rows($result)
    $不是@ ,函数名只能以英文字符串或下划线开头
      

  4.   

    if($mysqli_num_rows($result)<1)
    这里多了个$符号
      

  5.   

    。。OTL 感谢LS的追问一句,这样判断记录是否为空正确吗?谢谢啊