<li data-role="collapsible">
<h1>中奖信息</h1>
<ul>
<?php
$sql = "select * from t_activity where MemberID='$memberID'";
$res = $db->GetData($sql);
while ($obj = mysqli_fetch_object($res))
{
?>
<li><?php echo $obj->字段 ;?></li>
<?php
}
?>
</ul>
</li>
<h1>中奖信息</h1>
<ul>
<?php
$sql = "select * from t_activity where MemberID='$memberID'";
$res = $db->GetData($sql);
while ($obj = mysqli_fetch_object($res))
{
?>
<li><?php echo $obj->字段 ;?></li>
<?php
}
?>
</ul>
</li>
$sql = "select count(*) from t_activity where MemberID='$memberID'";
$res = $db->ExecSql($sql);
$num = mysqli_num_rows($res);
问下mysql,怎么统计查询count(*) 的行数,用上面的方法一直不成功!
$sql = "select count(*) from t_activity where MemberID='$memberID'";
$res = $db->ExecSql($sql);
$num = mysqli_num_rows($res);
问下mysql,怎么统计查询count(*) 的行数,用上面的方法一直不成功!
$num打印出来是什么?
$sql = "select count(*) from t_activity where MemberID='$memberID'";
$res = $db->ExecSql($sql);
$num = mysqli_num_rows($res);
问下mysql,怎么统计查询count(*) 的行数,用上面的方法一直不成功!
$num打印出来是什么?打印出来1,但数据库有3条
$row = mysqli_fetch_row($res);
$num = $row[0];
echo $num[0];或者
list($num) = mysqli_fetch_row($res);或者
$num = crrrent(mysqli_fetch_row($res));