Forum Moderators: coopster
$host='server.name';
$user='user_name';
$pass='my_password';
@mysql_connect($host,$user,$pass) or die("Unable to connect to database server: " . mysql_error());
@mysql_select_db("database") or die("Unable to open database: " . mysql_error());
$sql="INSERT INTO table (field1, field2, etc) VALUES ($value1, $value2, $etc)";
@mysql_query($sql) or die("Unable to query database: " . mysql_error());
echo "Record added to database";
It's giving me the following error:
Access denied for user 'user_name'@'ip.add.ress' (using password: YES)
You can also use the mysqli [php.net] extension and that should work, too, if the above is your problem.