Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
136 views
Welcome To Ask or Share your Answers For Others

1 Answer

You forgot to echo your results.

Change

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

To

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

Or

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...