From 056022aa1c28383cec9374b21b5250afb1a64e0e Mon Sep 17 00:00:00 2001 From: xice Date: Sat, 14 Jul 2018 22:35:51 +0800 Subject: [PATCH] to test this --- testdb.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/testdb.php b/testdb.php index 2d807d0..9c3630c 100644 --- a/testdb.php +++ b/testdb.php @@ -18,11 +18,13 @@ $flag = 0; $random = $randomArray[$i]; $result = mysqli_query($con,"SELECT * FROM Persons WHERE num='$random'"); - while($row = mysqli_fetch_array($result)){ + $row = mysqli_fetch_array($result) $count += 1; echo "当前查询次数:$count, 查询行数: $random, 查询题号: $i"; //html - $flag = 1; + if($row) { + $flag = 1; + } echo "
"; echo "
". $i. ".". $row['q'] ."
\n

"; echo "\n\n"; @@ -33,7 +35,7 @@ } echo "

\n"; echo "
\n"; - } + echo $flag; if($flag == 0){ $i--;