Advertisement
Guest User

Untitled

a guest
Jan 27th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. <?php
  2. $servername = "mysql.hostinger.pl";
  3. $username = "u528067218_kuba";
  4. $password = "*********";
  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. $conn->query("UPDATE posty SET post='$content' WHERE id=1");
  15.  
  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