The syntax for connecting to MySQL is:
$conn = mysql_connect("hostname","username","password");
The returned value ($conn) is an integer value corresponding to the link identifier returned from the database server. It's always best to check that a connection could actually be established before continuing:
$conn = mysql_connect("localhost","root","");
if(!$conn) {
exit("Unable to connect to the database.");
}
$db = mysql_select_db("test",$conn);
if(!$db) {
exit("Unable to select the test database");
}
MySQL does not need to be in a particular directory, but the PHP interpreter needs to know where it is....
Have fun...