I'm trying to write a simple script to store four bits of info about a user in a MySQL database, taking info from a form, using this :
<?
$server="myserver"
$username="myuser";
$password="mypassword";
$database="mydatabse";
$first=$_POST['first'];
$last=$_POST['last'];
$email=$_POST['email'];
$password=md5($_POST['password']);
mysql_connect($server,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO users VALUES ('$email','$first','$last','$password')";
mysql_query($query);
mysql_close();
?>
But when I execute I get
Warning: mysql_connect(): Access denied for user: 'myuser@myserver' (Using password: YES) in /home/www/hendriks.freeserverhost.net/eclipseware/signup.php on line 13
![]()
I have connected fine to this same database with other scripts, the table I'm accessing is definitely there, and of course all the myuser, myserver etc. have just replaced my real info, but I definitely have it right.
Any ideas?


LinkBack URL
About LinkBacks


Reply With Quote


