Advertisement
Guest User

Untitled

a guest
Jan 28th, 2016
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1. <?php
  2. $servername = "mysql.hostinger.pl";
  3. $username = "u528067218_kuba";
  4. $password = "12345";
  5. $db = "u528067218_baza";
  6. $content = $_POST['POSTY'];
  7.  
  8. $conn = new mysqli($servername, $username, $password,$db);
  9.  
  10. if ($conn->connect_error) {
  11.     die("Connection failed: " . $conn->connect_error);
  12. }
  13.  
  14.  
  15. $conn->query($conn->query("INSERT INTO posty  VALUES ('$content','NULL')"));
  16. $sql = "SELECT * FROM posty";
  17. $result = $conn->query($sql);
  18. if ($result->num_rows > 0) {
  19.     // output data of each row
  20.      while($row = $result->fetch_assoc()) {
  21.     echo '<table width="1000">';
  22.     echo "<tr>";
  23.        
  24.         echo  "<td>".$row['post']."</td>";
  25.         echo "</tr>";
  26.          
  27.          
  28.          
  29.     echo "</table>";
  30.     }
  31.    
  32. } else {
  33. }
  34.  
  35. $conn->close();
  36.  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement