Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "mysql.hostinger.pl";
- $username = "u528067218_kuba";
- $password = "12345";
- $db = "u528067218_baza";
- $content = $_POST['POSTY'];
- $conn = new mysqli($servername, $username, $password,$db);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $conn->query($conn->query("INSERT INTO posty VALUES ('$content','NULL')"));
- $sql = "SELECT * FROM posty";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- echo '<table width="1000">';
- echo "<tr>";
- echo "<td>".$row['post']."</td>";
- echo "</tr>";
- echo "</table>";
- }
- } else {
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement