Advertisement
Guest User

Untitled

a guest
Apr 21st, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. <?php
  2. // This file is www.developphp.com curriculum material
  3. // Written by Adam Khoury January 01, 2011
  4. // http://www.youtube.com/view_play_list?p=442E340A42191003
  5. /*
  6. 1: "die()" will exit the script and show an error statement if something goes wrong with the "connect" or "select" functions.
  7. 2: A "mysql_connect()" error usually means your username/password are wrong
  8. 3: A "mysql_select_db()" error usually means the database does not exist.
  9. */
  10. // Place db host name. Sometimes "localhost" but
  11. // sometimes looks like this: >> ???mysql??.someserver.net
  12. $db_host = "localhost";
  13. // Place the username for the MySQL database here
  14. $db_username = "db_username_here";
  15. // Place the password for the MySQL database here
  16. $db_pass = "db_password_here";
  17. // Place the name for the MySQL database here
  18. $db_name = "name_of_database_here";
  19.  
  20. // Run the actual connection here
  21. mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql");
  22. mysql_select_db("$db_name") or die ("no database");
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement