Advertisement
Guest User

Untitled

a guest
Aug 10th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. $servername = "localhost";
  2.  
  3. $username = "root";
  4.  
  5. $password = "admin";
  6.  
  7.  
  8.  
  9. try {
  10.  
  11. $conn = new PDO("mysql:host=$servername;dbname=main", $username, $password);
  12.  
  13. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  14.  
  15. echo "Connected successfully";
  16.  
  17. }
  18.  
  19. catch(PDOException $e){
  20.  
  21. echo "Connection failed: " . $e->getMessage();
  22.  
  23. }
  24.  
  25. $stmt = $conn->prepare('INSERT INTO `main`.`accounts` (`createdate`, `recentdate`, `username`, `themeset`, `totaluses`, `isonline`, `horoscope`, `age`, `profilepic`) VALUES (CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '$name', '0', '0', '1', '0', '18', '$id')');
  26.  
  27. $stmt->execute();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement