Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- $db_host="localhost";
- $db_user="root";
- $db_password="";
- $db_name="versandhandel";
- $db=new PDO("mysql:host=$db_host; dbname=$db_name; charset=utf8", $db_user, "");
- $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title> </title>
- </head>
- <body>
- <h3>tartikel</h3>
- <table border="3">
- <tr>
- <td>AR_ID</td>
- <td>AG_FS</td>
- <td>Bezeichnung</td>
- <td>Listenpreis</td>
- <td>MW_FS</td>
- <td>Bestand</td>
- <td>Mindestbestand</td>
- <td>Lagerplatz</td>
- </tr>
- <?PHP
- $sql="SELECT * FROM tartikel";
- $stmt=$db -> prepare($sql);
- $stmt -> execute ();
- while($row = $stmt -> fetch(PDO::FETCH_ASSOC)) {
- echo "<tr>";
- echo "<td>" .$row['AR_ID'] ."</td>";
- echo "<td>" .$row['AG_FS'] ."</td>";
- echo "<td>" .$row['Bezeichnung'] ."</td>";
- echo "<td>" .$row['Listenpreis'] ."</td>";
- echo "<td>" .$row['MW_FS'] ."</td>";
- if($row['Bestand']<$row['Mindestbestand']){
- echo "<td bgcolor='#F00'>" .$row['Bestand'] ."</td>";
- }
- else{
- echo "<td>" .$row['Bestand'] ."</td>";
- }
- echo "<td>" .$row['Mindestbestand'] ."</td>";
- echo "<td>" .$row['Lagerplatz'] ."</td>";
- echo "<tr>";
- }
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement