Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // This file is www.developphp.com curriculum material
- // Written by Adam Khoury January 01, 2011
- // http://www.youtube.com/view_play_list?p=442E340A42191003
- /*
- 1: "die()" will exit the script and show an error statement if something goes wrong with the "connect" or "select" functions.
- 2: A "mysql_connect()" error usually means your username/password are wrong
- 3: A "mysql_select_db()" error usually means the database does not exist.
- */
- // Place db host name. Sometimes "localhost" but
- // sometimes looks like this: >> ???mysql??.someserver.net
- $db_host = "localhost";
- // Place the username for the MySQL database here
- $db_username = "db_username_here";
- // Place the password for the MySQL database here
- $db_pass = "db_password_here";
- // Place the name for the MySQL database here
- $db_name = "name_of_database_here";
- // Run the actual connection here
- mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql");
- mysql_select_db("$db_name") or die ("no database");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement