Guest User

Untitled

a guest
Mar 20th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2.  
  3. include '../includes/config.php';
  4. //Input Data Process
  5. $row = mysqli_fetch_array($query);
  6. if (isset($_POST["post"])) {
  7. $title = $_POST["title"];
  8. $description = $_POST["description"];
  9. $article = $_POST["article"];
  10. mysqli_query($conn, "INSERT INTO post VALUES('','$title','$description','$article')");
  11. header("location:index.php?article");
  12. }
  13. $query = mysqli_query($conn, "SELECT * FROM post");
  14.  
  15. ?>
  16.  
  17. <?php
  18.  
  19.  
  20. //Database Connection
  21. global $conn;
  22.  
  23. $servername = "localhost";
  24. $username = "root";
  25. $password = "";
  26. $db = "my_blog";
  27.  
  28. $conn = mysqli_connect($servername, $username, $password, $db);
  29.  
  30. //Check Connection
  31. if (!$conn) {
  32. die("Connection Failed : ".mysqli_connect_error());
  33. }
  34.  
  35.  
  36. ?>
Add Comment
Please, Sign In to add comment