Guest User

Untitled

a guest
Sep 2nd, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. <?php
  2.  
  3. $dsn = 'mysql:dbname=my_twitter;host=127.0.0.1';
  4. $user = 'root';
  5. $password = '';
  6.  
  7.  
  8. $connection = new PDO($dsn, $user, $password);
  9.  
  10. $statement = $connection->prepare('SELECT * FROM `users` WHERE id = :id;');
  11. $statement->bindParam(':id', 1, PDO::PARAM_INT);
  12. $statement->execute();
  13.  
  14. $result = $statement->fetch(PDO::FETCH_ASSOC); ;
Add Comment
Please, Sign In to add comment