Advertisement
pan7nikt

auta/select.php

Mar 7th, 2022
989
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.91 KB | None | 0 0
  1. <?php
  2. /*
  3. Wyświetlenie zawartości tabeli auta
  4. */
  5.  
  6. include('laczenie.php');
  7.  
  8. $auta = mysqli_query($db,"SELECT auta.*,kolory.Kolor FROM auta INNER JOIN kolory ON auta.IdKolor=kolory.IdKoloru");
  9. $IleAut = mysqli_num_rows($auta);
  10.  
  11. echo('<br /><br /><table border="1" width="400">');
  12.  
  13. echo('<tr>
  14.                     <th>IdAuta</th>
  15.                     <th>Marka</th>
  16.                     <th>Model</th>
  17.                     <th>Cena</th>
  18.                     <th>Kolor</th>
  19.                     <th>Usuwanie</th>
  20.                     <th>Edycja</th>
  21.             </tr>');
  22.            
  23. for ($i=1; $i <= $IleAut; $i++)
  24. {
  25.     $auto = mysqli_fetch_array($auta);
  26.     echo('<tr>
  27.                     <td>'.$auto['IdAuta'].'</td>
  28.                     <td>'.$auto['Marka'].'</td>
  29.                     <td>'.$auto['Model'].'</td>
  30.                     <td>'.$auto['Cena'].'</td>
  31.                     <td>'.$auto['Kolor'].'</td>
  32.                     <td><a href="index.php?Wybor=4&&IdAuta='.$auto['IdAuta'].'">Usuń</a></td>
  33.                     <td><a href="index.php?Wybor=5&&IdAuta='.$auto['IdAuta'].'">Edytuj</a></td>
  34.                 </tr>');
  35. }
  36. echo('</table>');
  37.  
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement