Fetch multiple entries from a single get id in php sql

31
May 06, 2021, at 2:50 PM

Code to fetch data from database

<?php     
  $con=mysqli_connect("localhost","root","","mta_bd");
  $query=mysqli_query($con,"SELECT * from all_stores WHERE suporder=".$_GET['id']);
    $result =mysqli_fetch_array($query);
      while ($row = mysqli_fetch_assoc($query)) {
                             
            echo '<tr>';
            echo '<td>'. $row['name'].'</td>';
            
            echo '<td>'. $row['qty'].'</td>';
            echo '<td>'. $row['auth_unit'].'</td>';
      
            echo '<td>'. $row['cost'].'</td>';
            echo '</tr>'

But this is fetching only one entry from the table it is linked.

<?php   
  $con=mysqli_connect("localhost","root","","mta_bd");
  $sql=mysqli_query($con,"SELECT * from all_stores where suporder >= 0 group by suporder");
  $query=mysqli_fetch_array($sql) ;              
          
  while ($row = mysqli_fetch_assoc($sql)) {
    echo '<tr>';
    echo '<td>'. $row['sup_date'].'</td>';
    echo '<td>'. $row['suporder'].'</td>';
       echo '<td>'. $row['job_no'].'</td>';
    echo '<td align="right"> <div class="btn-group"><a type="button" class="btn btn-primary bg-gradient-primary"href="supplyorder.php?action=edit & id='.$row['suporder'] . '"><i class="fas fa-fw fa-list-alt"></i> Data</a>
echo'</td>';

I want to fetch all data related to the supplyorder fetched with GET function.

READ ALSO
How to add time stamp to push notifications when on group - Raact Native - Android

How to add time stamp to push notifications when on group - Raact Native - Android

I have implemented push notifications on android and ios

53
The width of the footer of one of my web pages is shrinking more than it should on a small screen and not appearing at the bottom - how to correct it?

The width of the footer of one of my web pages is shrinking more than it should on a small screen and not appearing at the bottom - how to correct it?

The width of the footer of one of my webpage is shrinking more than it should on a small screen and not appearing at the bottom - how to correct it?

90
PHP how do I make a button which will not make an image transparent

PHP how do I make a button which will not make an image transparent

So I am making an image game and I want the images to reappear from being transparent when a button is pressedHow do I do this in php

55
bootstrap-fullscreen-select fire onchange event?

bootstrap-fullscreen-select fire onchange event?

I am using select option for full screen http://craftpipgithub

62