Cannot call the mysql database in php

admin

Administrator
Staff member
Dears,

The following php statement still cannot connect to the specific database mydb,

line 4: $db=mysql_connect("local","root");
line 5: mysql_select_db("mydb",$db);

the error message prompts out

Warning: Supplied argument is not valid mysql result resource in
/home/simon/public_html/first.php on line 5.

Before that,I have tested the existence of the database, mydb, in the computer under linux terminal by using the following commands.

shell > mysql
mysql> use mydb;
mysql> select * from employees

the data are then displayed out.

Please give me some solutions on the configuration setting, thanks.

Sincerely yours,
Simon
 
Back
Top