Guest User

Untitled

a guest
Mar 17th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. <?php
  2. require('connect.php');
  3. $id = $_GET['id'];
  4.  
  5. $sql = "SELECT * FROM blog";
  6. $stmt=$conn->prepare($sql);
  7. $stmt->execute(['blogid' => $id]);
  8.  
  9. if($stmt->rowCOunt() < 1){
  10. echo '<h1>Could find blog post </h1>';
  11. require('footer.php');
  12. exit;
  13. }
  14.  
  15. <?php
  16. $servername="localhost";
  17. $username="a";
  18. $password="";
  19.  
  20. $conn = new PDO("mysql:host=$servername;dbname=local",$username,$password);
Add Comment
Please, Sign In to add comment