daily pastebin goal
78%
SHARE
TWEET

Untitled

a guest Apr 27th, 2016 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?PHP
  2.     $db_host="localhost";
  3.     $db_user="root";
  4.     $db_password="";
  5.     $db_name="versandhandel";
  6.  
  7.     $db=new PDO("mysql:host=$db_host; dbname=$db_name; charset=utf8", $db_user, "");
  8.     $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
  9. ?>
  10.  
  11. <!DOCTYPE html>
  12. <html>
  13.     <head>
  14.     <meta charset="utf-8" />
  15.         <title> </title>
  16.     </head>
  17.     <body>
  18.     <h3>tartikel</h3>
  19.     <table border="3">
  20.         <tr>
  21.             <td>AR_ID</td>
  22.             <td>AG_FS</td>
  23.             <td>Bezeichnung</td>
  24.             <td>Listenpreis</td>
  25.             <td>MW_FS</td>
  26.             <td>Bestand</td>
  27.             <td>Mindestbestand</td>
  28.             <td>Lagerplatz</td>
  29.         </tr>
  30.        
  31.         <?PHP
  32.             $sql="SELECT * FROM tartikel";
  33.             $stmt=$db -> prepare($sql);
  34.             $stmt -> execute ();
  35.            
  36.             while($row = $stmt -> fetch(PDO::FETCH_ASSOC)) {
  37.                 echo "<tr>";
  38.                     echo "<td>" .$row['AR_ID'] ."</td>";
  39.                     echo "<td>" .$row['AG_FS'] ."</td>";
  40.                     echo "<td>" .$row['Bezeichnung'] ."</td>";
  41.                     echo "<td>" .$row['Listenpreis'] ."</td>";
  42.                     echo "<td>" .$row['MW_FS'] ."</td>";
  43.                     if($row['Bestand']<$row['Mindestbestand']){
  44.                         echo "<td bgcolor='#F00'>" .$row['Bestand'] ."</td>";
  45.                     }
  46.                     else{
  47.                         echo "<td>" .$row['Bestand'] ."</td>";
  48.                     }
  49.                     echo "<td>" .$row['Mindestbestand'] ."</td>";
  50.                     echo "<td>" .$row['Lagerplatz'] ."</td>";
  51.                 echo "<tr>";
  52.             }
  53.         ?>
  54.     </table>
  55.     </body>
  56. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top