Advertisement
Guest User

Untitled

a guest
Jan 10th, 2018
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <?php
  2.  
  3. echo "<br>";
  4.  
  5. //SQL server cfg
  6. $servername = "localhost";
  7. $username = "root";
  8. $password = "123456789";
  9. $dbname = "EddyDB";
  10.  
  11. $conn=mysqli_connect($servername, $username, $password, $dbname);
  12. if($conn == false){
  13. die("ERROR Could not connect to SQL.".mysqli_connect_error());
  14. }
  15.  
  16. $sql2= "SELECT * FROM Tabelle01";
  17. $result_1 = mysql_query($conn, $sqL2);
  18.  
  19. //IN TABELLE ANZEIGEN
  20. if ($result_1->num_rows >0){
  21.     echo "<b> Status of Sensor 1: </b>";
  22.     echo "<table border=1><tr><th>X1</th><th>X2</th><th>Message</th></tr>";
  23.     //jede Reihe daten ausgeben
  24.     while($row= $result_1->fetch_assoc()){
  25.         echo "<tr><td>".$row["X1"]."</td><td>".$row["X2"]."</td><td>".$row["msg"]."</td></tr>";
  26.     }
  27.     echo "</table>";
  28. } else{
  29.         echo "0 Results";
  30. }
  31.  
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement