PHP MySQL 只显示空白表 [英] PHP MySQL only displays Blank Table

查看:39
本文介绍了PHP MySQL 只显示空白表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天!我在显示表格中的数据时遇到问题.我已经输入了 6 个数据,它会显示我的 $i++ 中有多少个基数,但它没有显示用户名、全名和 udate.我真的很感激请和谢谢!表格显示 这是我的代码:

Good Day! Im having a problem displaying the data from table. I have already inputted 6 data and it will show how many base from my $i++ but it does not show the userno, fullname and udate. i would really appreciate it Please and thank you! Table Display Here is my code:

table class="table table-striped table-sm">
  <thead>
    <tr>
      <th>No</th>
      <th>User No</th>
      <th>User Name</th>
      <th>Date Registered</th>
    </tr>
  </thead>
  <tbody>

    <?php
      $i=0;
      $uquery= mysqli_query($conn, "SELECT * FROM users");
      while ($uresult=mysqli_fetch_array($uquery)){

      $i++;  
    ?>
      <tr>
        <td><?php echo $i;?></td>
        <td><?php $uresult ['userno'];?></td>
        <td><?php $uresult ['fullname'];?></td>
        <td><?php $uresult ['udate'];?></td>

    <?php }; ?> 
  </tbody>
</table>

推荐答案

你忘记回应你的结果.

改变

<td><?php $uresult ['userno'];?></td>
<td><?php $uresult ['fullname'];?></td>
<td><?php $uresult ['udate'];?></td>

<td><?php echo $uresult ['userno'];?></td>
<td><?php echo $uresult ['fullname'];?></td>
<td><?php echo $uresult ['udate'];?></td>

<td><?= $uresult ['userno'];?></td>
<td><?= $uresult ['fullname'];?></td>
<td><?= $uresult ['udate'];?></td>

这篇关于PHP MySQL 只显示空白表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆