时间:2021-07-01 10:21:17 帮助过:7人阅读
- <!--?php if (isset($_GET['userid'])) { $row1id=$_GET['userid']; // echo "$row1id"; $query2="SELECT * FROM user WHERE u_id=$row1id"; $result2=mysqli_query($conn,$query2); // echo "我取得ID了"; while ($row2=mysqli_fetch_assoc($result2)) { if (!empty($row2)) { echo $row2['username']."--".$row2['tphone']; }else{ echo "还没有添加数据"; } } }else{ echo "我没有取得ID"; } ?-->
while ($row2=mysqli_fetch_assoc($result2)) {
当 $row2 为空时,不会进入循环体
自然也不会输出 还没有添加数据
while ($row2=mysqli_fetch_assoc($result2)) {
当 $row2 为空时,不会进入循环体
自然也不会输出 还没有添加数据