Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/233.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在PHP中回显addressbook的表_Php_Mysqli_Echo - Fatal编程技术网

如何在PHP中回显addressbook的表

如何在PHP中回显addressbook的表,php,mysqli,echo,Php,Mysqli,Echo,我正试图用PHP构建一个地址簿,但我在某一点上被卡住了。如何回显自动添加表行以显示addresbook中的下一个用户的表,以及如何在同一个表中显示addressbook中的所有用户 这是我现在的密码。我希望有人能帮助我 试试: 有关更多详细信息,请查看脚本中是否包含$conn。 如果连接正确 删除以前的$user=mysqli\u fetch\u assoc($userQuery) 然后这样做: <?php while ($user = mysqli_fetch_assoc($use

我正试图用PHP构建一个地址簿,但我在某一点上被卡住了。如何回显自动添加表行以显示addresbook中的下一个用户的表,以及如何在同一个表中显示addressbook中的所有用户

这是我现在的密码。我希望有人能帮助我

试试:



有关更多详细信息,请查看脚本中是否包含$conn。 如果连接正确
删除以前的$user=mysqli\u fetch\u assoc($userQuery)
然后这样做:

<?php
while ($user = mysqli_fetch_assoc($userQuery)) {
?>
<tr>
    <td><?=$user['roepnaam']?></td>
    <td><?=$user['naam']?></td>
    <td><?=$user['bedrijf']?></td>
  </tr>
<?php
    }
?>


它不起作用,如果我在代码中使用它,它不会回显任何内容。在代码中更改了它。您可以在该页面的顶部看到它remove
$user=mysqli\u fetch\u assoc($userQuery)从您的else块
<?php
while ($user = mysqli_fetch_assoc($userQuery)) {
?>
<tr>
    <td><?=$user['roepnaam']?></td>
    <td><?=$user['naam']?></td>
    <td><?=$user['bedrijf']?></td>
  </tr>
<?php
    }
?>