jeaker Posted November 6, 2006 Share Posted November 6, 2006 I was wondering if there were any PHP masters that could help me out. I cannot spot any errors in the code but i am fairly new to PHP. It is giving me an access denied error. Any help would be greatly appreciated.[code]<?phpif ((!$_POST[id]) || (!$_POST[format]) || (!$_POST[title])) { header( "Location: show_addrecord.html"); exit;}$db_name = "testdb";$table_name = "my_music";I know this part is correct-[$connection = @mysql_connect('db.blah.blahwebsites.com', 'jondoe', '********') or die(mysql_error());]$db = mysql_select_db($db_name, $connection) or die(mysql_error()); $sql = "INSERT INTO $table_name (id, format, title, artist_fn, artist_ln, rec_label, my_notes, date_acq) VALUES ('$_POST[id]', '$_POST[format]', '$_POST[title]', '$_POST[artist_fn]', '$_POST[artist_ln]', '$_POST[rec_label]', '$_POST[my_notes]', '$_POST[date_acq]')";$result = @mysql_query($sql, $connection) or die(mysql_error());?>[/code] Link to comment https://forums.phpfreaks.com/topic/26349-having-some-connection-issues/ Share on other sites More sharing options...
Orio Posted November 6, 2006 Share Posted November 6, 2006 What error are you getting?Orio. Link to comment https://forums.phpfreaks.com/topic/26349-having-some-connection-issues/#findComment-120486 Share on other sites More sharing options...
jeaker Posted November 6, 2006 Author Share Posted November 6, 2006 I am getting the error.Access denied for user 'jondoe'@'%.modwest.com' to database 'testDB' Link to comment https://forums.phpfreaks.com/topic/26349-having-some-connection-issues/#findComment-120506 Share on other sites More sharing options...
Orio Posted November 6, 2006 Share Posted November 6, 2006 You have to give privileges to the user "johndoe".Orio. Link to comment https://forums.phpfreaks.com/topic/26349-having-some-connection-issues/#findComment-120510 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.