CrazyDiamond

CommentShow.php

Jun 13th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.94 KB | None | 0 0
  1. <?php
  2.  
  3.       $servername = "localhost";
  4.       $username = "student";
  5.       $password = "stud.net";
  6.       $dbname = "Reports";
  7.  
  8.       // Create connection
  9.       $conn = new mysqli($servername, $username, $password, $dbname);
  10.       // Check connection
  11.       if ($conn->connect_error) {
  12.           die("Connection failed: " . $conn->connect_error);
  13.       }
  14.  
  15.       $sql = "SELECT date, client, text FROM $reportNum";
  16.       $result = $conn->query($sql);
  17.  
  18.       if ($result->num_rows > 0) {
  19.           // output data of each row
  20.           while($row = $result->fetch_assoc()) {
  21.               print "
  22.                 <b>client at </b> "{$row["date"]}"<b> from</b> "{$row["client"]}"              
  23.                 <br> <mark> "{$row["text"]}"</mark>
  24.             ";
  25.             $rowid=$row["id"];
  26.             include'Pre.Delete.php';
  27.             echo"<br>";
  28.             echo"<p>".DB."</p>";//this for testing purpose
  29.           }
  30.       } else {
  31.           echo "0 results";
  32.       }
  33.       $conn->close();
  34.  
  35.     ?>
Add Comment
Please, Sign In to add comment