Location: PHPKode > projects > Chirp: The Microblog > chirp.v.1.1/docs/doc.03.db.txt
Now that we have the .htaccess file and the database created it

is time to connect to the database.  Some of the information you

may know otherwise you will need to ask your administrator.  We

will assume that the database you created was named chirp and your

database username and password are root and password respectively.



Open the db.inc.php file located in the includes directory of the 

chirp installation.  Remember I told you about Notepad++ at 

http://notepad-plus-plus.org/  Now is the time to use it.



In notepad++ you want to edit the following variables.



	$dbhost = 

	$database = 

	$dbusername = 

	$dbpasswd = 

	

The first thing we add is the mysql server.  For most you can put 

localhost as mysql server otherwise you will need to put what your

isp tells you to put.  The entry should look like this.



	$dbhost = 'localhost';

	

Notice the single quotes?  The quotes are very important when filling

in the information.  At the end of each line is a semicolon (;). This

is important and signifies the end of the line.  Without the quotes

and the semicolonthe script will fail to run.



Next, add your database.  Remember, we named it chirp so the entry should 

look like this:



	$database = 'chirp';

	

Finally, add your username and password



	$dbusername = 'root'; 

	$dbpasswd = 'password';

	

There you have it.  These are the only entries you need to make to 

the file.  A big note you should be aware of.  Case counts, so a word

like HELLO is very different than the word hello, Hello, hEllo, etc.

Having improper case will also stop your script from working.



When you are done, the file contents should look like this:



<?php



	$dbhost = 'localhost';

	$database = 'chirp';

	$dbusername = 'root';

	$dbpasswd =  'password';

	

	// ============= Do not edit below here ======================

	$connection = mysql_connect($dbhost,$dbusername,$dbpasswd) or die ('Could not connect to the database server.');

	$db = mysql_select_db($database) or die ('Could not connect to the database.');

	

?>  
Return current item: Chirp: The Microblog