0

我正在尝试显示计数,但仅在列deleted等于 0的情况下

这是我尝试过的

$result=mysql_query("SELECT * FROM users where deleted=0")or die('Error ' );

$counter = mysql_query("SELECT COUNT(*) as personID FROM users");
$row = mysql_fetch_array($result);

    $personID = $row['personID'];
    $personFname = $row['personFname'];
    $personSname = $row['personSname'] ;
    $llmail = $row['llmail'];
    $mainadmin = $row['mainadmin'];
     $delete = $row['delete'];
$num = mysql_fetch_array($counter);
$count1 = $num["personID"];

这显示了 4 的计数,但是 4、2 被删除了,所以如果这有意义,它应该只显示 2?

4

1 回答 1

0
SELECT COUNT(*) as personID FROM users WHERE deleted=0
于 2013-10-31T20:04:26.800 回答