2021年1月21日星期四

MySQLi Displaying Results in a Table

I'm trying to display generated data from PHPMyAdmin into a table using MySQLi and I can't seem to figure it out.

            <tr>                  <th scope="col">Link</th>                  <th scope="col">Category</th>              </tr>              <?php                  //Connection Information              $connection = mysqli_connect('localhost','root',''); //establish connection to db              $selected = mysqli_select_db($connection, 'sample'); //select db                                    //SQLi Statements              $viewQuery = "select * from link JOIN categories";              $execute = mysqli_query($connection,$viewQuery);              if($execute)                  {                  while($row = mysqli_fetch_array($execute))                  {                      $link = $row['link'];                      $category = $row['category'];                  }                  }              ?>              <tr>                  <td><?php echo $link; ?></td>                  <td><?php echo $category; ?></td>              </tr>              </table>  

Is there something I'm missing? I'm new to MySQLi

https://stackoverflow.com/questions/65838391/mysqli-displaying-results-in-a-table January 22, 2021 at 10:06AM

没有评论:

发表评论