I'm trying to learn PHP and MySql. I'm using Phpmyadmin on a virtual hosting plan. I've created a test database and added a few records. Now I'm trying to create a php document to display the records but I'm having trouble connecting to the database. The code I've used is a s follows
<?PHP $db = @mysql_connect("localhost", "root ", "password");
mysql_select_db("mydb",$db);
I've substituted "localhost" for the url of the virtual hosting company and "root " for my username. But when I call up the php page I get an error like "Warning: Supplied argument is not a valid MySQL-Link resource in /home/sites/site101/web/test.php on line 2". Do I need to enter the actual full URL to my database and if so how do I know what that is?
I am a complete PHP and MySql beginner so I might have totally the wrong Idea here??