connecting to mySQL DB
I am running panther with the newest release of mySQL (version 4.0.18) and php. I am hosting the website for my band on this website and I am trying to connect to the database, but I am having some problems. Here is my php code:
$db = mysql_connect(":/usr/local/mysql/data", "root","myPassword");
mysql_select_db("shows",$db);
I have already created a database called DreyfusAffair (the band name) and a table inside of it called shows. Where do I specify the database at? Any help with why I can't connect to it would be greatly appreciated. Thanks.
Brian
$db = mysql_connect(":/usr/local/mysql/data", "root","myPassword");
mysql_select_db("shows",$db);
I have already created a database called DreyfusAffair (the band name) and a table inside of it called shows. Where do I specify the database at? Any help with why I can't connect to it would be greatly appreciated. Thanks.
Brian
Comments
Assuming your syntax is currently correct (I use PEAR:B to connect to MySQL), then it should be:
$db = mysql_connect("localhost", "root", "myPassword");
mysql_select_db("shows", $db);