When I am running my code it is giving following error - Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'sanganak_arch'@'localhost' (using password: YES) in E:\xampplite\htdocs\practice\sunil\showdata2.php on line 10 Could not connect: Access denied for user 'sanganak_arch'@'localhost' (using password: YES) my code is following - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php $con = mysql_connect("localhost","sanganak_arch","reset123"); if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("sanganak_mydata",$con); $result = mysql_query("SELECT * FROM mytable"); while($row = mysql_fetch_array($result)) { echo $row['name'] . " " . $row['age']; echo "<br />"; }mysql_close($con); ?> </body> </html> I have given all privileges to my database. Please solve this error.
Thus you suppose PHP thinks that there are not enoigh priveleges. Check you priveledges once again or try root user with empty password.