Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting an error..
Cannot select DB:Access denied for user "@'local host' to database 'clg'..
How do I solve it???
Posted
Comments
jacobjohn196 14-Apr-14 3:08am    
Check Your Connection string.Make sure that you have given correct userid and password.

1 solution

I think you have given wrong syntax for the database connection try following code

PHP
mysql_connect("localhost","root","db_password")or die(mysql_error());
mysql_select_db("database_name");
?>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900