Advertisement
Guest User

Untitled

a guest
Feb 1st, 2016
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 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. $conn = new mysqli($servername, $username, $password,$db);
  8.  
  9. if ($conn->connect_error) {
  10.     die("Connection failed: " . $conn->connect_error);
  11. }
  12. $conn->query("INSERT INTO posty VALUES('$content','NULL'");
  13.  
  14. $sql = "SELECT * FROM posty";
  15. $result = $conn->query($sql);
  16. if ($result->num_rows > 0) {
  17.     // output data of each row
  18.      while($row = $result->fetch_assoc()) {
  19.     echo '<table width="1000">';
  20.     echo "<tr>";
  21.        
  22.         echo  "<p style='color:white; font-size:18px; padding:6px;'>".$row['post'].'</td>'."</p>";
  23.                                                                                                        
  24.         echo "</tr>";
  25.          
  26.          
  27.          
  28.     echo "</table>";
  29.     }
  30.    
  31. } else {
  32. }
  33.  
  34. $conn->close();
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement