如何从数据库中计算特定行。下面将对图像进行说明。期待帮助。 database
这里是我的密码
<?php
$q="SELECT * FROM donate WHERE
passport_IC=:passport_IC";
$row=$q->rowcount();
echo $row;
?>
答案 0 :(得分:0)
通过Mysql
SELECT COUNT(*) FROM Table;
将计算表中的行数。
请参见reference manual。
OR
通过PHP
<?php
$con=mysqli_connect("localhost","username","password","db_name");
$result=mysqli_query($con,"SELECT * FROM Table")
$rowcount=mysqli_num_rows($result);
printf("Result set has %d rows.\n",$rowcount);
?>