Advertisement
Guest User

Untitled

a guest
May 21st, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  1. <?php
  2.   require_once "db_connection.php";
  3.  
  4.   if(isset($_GET["ort"])){
  5.     $sql = "SELECT abMenge, artBezeichnung, bstZeit, bstLieferOrt
  6.    FROM tblArtikel
  7.    LEFT JOIN tblbestellteartikel on(p_artNummer = f_artNummer)
  8.    LEFT JOIN tblbestellungen on (p_bstNummer = f_bstNummer)
  9.    WHERE bstLieferOrt like '$_GET[ort]'
  10.    GROUP BY artBezeichnung, bstZeit, bstLieferOrt;";
  11.  
  12.     $result = $db-> query($sql);
  13.   }
  14. ?>
  15.  
  16. <html>
  17.  
  18.   <head>
  19.     <title> Penis </title>
  20.   </head>
  21.  
  22.   <body>
  23.     <form method="GET">
  24.       <input type="text" name="ort">
  25.       <input type="submit">
  26.       <br><br>
  27.     <form>
  28.  
  29.     <?php
  30.     if(isset($_GET["ort"])){
  31.       if($result -> rowCount() > 0){
  32.     ?>
  33.       <table border="1">
  34.         <tr>
  35.           <th>Anzahl</th>
  36.           <th>Artikel</th>
  37.           <th>Zeitpunkt</th>
  38.           <th>Lieferadresse</th>
  39.         </tr>
  40.  
  41.       <?php
  42.         while($row = $result->fetch(PDO::FETCH_ASSOC) ){
  43.           $counter =0;
  44.           echo '<tr>';
  45.             echo "<td> $row[abMenge]</td>";
  46.             echo "<td> $row[artBezeichnung]</td>";
  47.             echo "<td> $row[bstZeit]</td>";
  48.             echo "<td> $row[bstLieferOrt]</td>";
  49.           echo '</tr>';
  50.           $counter++;
  51.         }
  52.         echo "Anzahl der Ergebnisse: ", $counter;  
  53.         }else{
  54.          echo "Kein Ergebnis";
  55.         }
  56.       ?>
  57.  
  58.       </table>  
  59.  
  60.     <?php  
  61.       }
  62.     ?>
  63.    
  64.   </body>
  65. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement