Re: Can't connect to wamp server for querying mysql DB.
Posted by:
archit_shukla13@yahoo.com (117.214.168.---)
Date: July 03, 2012 06:29PM
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'username'@'localhost' (using password: YES) in C:\wamp\www\PHP\database_connectivity.php on line 2
could not connect to DB:Access denied for user 'username'@'localhost' (using password: YES)
//gettin abov msg while connecting to wamp server for querying DB,,my new to PHP so plz help me with the same step by step.
original script is written below:
.............................
<?php
$con= mysql_connect("localhost","username","password"winking smiley;
if (!$con)
{
die('could not connect to DB:'.mysql_error());
}
if (mysql_query('CREATE DATABASE register',$con))
{
echo "database created";
}
else
{
echo "error creating DB".mysql_error();
}
mysql_close($con);
?>