Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想显示 PHP MySQL 中状态为 1(见代码)的用户数。
<?php // something like this $result = mysqli_query($mysqli, "SELECT COUNT(*) FROM users WHERE status = '1'"); echo "$result"; ?>
试试这个:
$query = "SELECT COUNT(*) as countvar FROM users where status = '1'"; $result = mysqli_query($con,$query); $row = mysqli_fetch_array($result); $count= $row['countvar '];