Advertisement
Guest User

Untitled

a guest
Aug 5th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <?php
  2.  
  3. //file to connect to database
  4.  
  5. $hostname = "localhost"; // your host
  6. $username = "root"; //username of your db
  7. $password = "martijn"; //password of your db
  8. $db_name = "easy_register_script";
  9.  
  10. $connect_db = mysql_connect('$hostname','$username','$password');
  11.  
  12. if(!$connect_db){
  13.  
  14. echo "'Couldn't connect to db, check host/username/password' . mysql_error() ";
  15. exit();
  16. }
  17.  
  18. $select_db = mysql_select_db('$db_name','$connect_db');
  19.  
  20. if(!select_db){
  21.  
  22. echo "'Couldn't find the db, going to make one, ok?' . mysql_error()";
  23. exit();
  24. }
  25.  
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement