Advertisement
Guest User

Untitled

a guest
Feb 4th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 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.  
  13.     $sql1 = "INSERT INTO posty VALUES('$content','NULL')";
  14.     $conn->query($sql1);
  15.    
  16.  
  17. $sql = "SELECT * FROM posty";
  18.  
  19. $result = $conn->query($sql);
  20.  
  21. if ($result->num_rows > 0) {
  22.     // output data of each row
  23.      while($row = $result->fetch_assoc()) {
  24.     echo '<table width="1000">';
  25.     echo "<tr>";
  26.        
  27.         echo  "<p style='color:white; font-size:18px; padding:6px;'>".$row['post'].'</td>'."</p>";
  28.                                                                                                        
  29.         echo "</tr>";
  30.          
  31.          
  32.          
  33.     echo "</table>";
  34.     }
  35.    
  36. } else {
  37. }
  38.  
  39. $conn->close();
  40.  
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement