docock
06-17-2010, 09:31 AM
I'm trying to execute the script below, but I'm getting this as result:
[phpBB Debug] PHP Notice: in file /mdwphp/add_gmember.php on line 47: mysql_query(): supplied argument is not a valid MySQL-Link resource
Er is een fout opgetreden: INSERT INTO 'hello' VALUES ('gpfsjaak','1', 'July 17 2010','pictures','test.jpg'); :Access denied for user 'a3718717_members'@'192.168.0.3' to database 'hello'
I'm using a phpbb script earlier in the script, but that has nothing to do with the error. The phpdebug says it's not a valid Mysql link resource at $result = mysql_query($string,$db_selected); Though I checked everything and all database/host settings are filled in correctly. Perhaps there is an error in the way I try to connect?
$string = "INSERT INTO 'hello' VALUES ('$gebruiker','1', '$today_plus_1_month','pictures','test.jpg');";
$con = mysql_connect("mysql3.***************","a3718717_members",$wachtwoord);
$db_selected = mysql_select_db('hello', $con);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$result = mysql_query($string,$db_selected);
if (!$result) {echo "Er is een fout opgetreden: $string :". mysql_error();}else{echo "1 record added";}
mysql_close($con);
}
?>
[phpBB Debug] PHP Notice: in file /mdwphp/add_gmember.php on line 47: mysql_query(): supplied argument is not a valid MySQL-Link resource
Er is een fout opgetreden: INSERT INTO 'hello' VALUES ('gpfsjaak','1', 'July 17 2010','pictures','test.jpg'); :Access denied for user 'a3718717_members'@'192.168.0.3' to database 'hello'
I'm using a phpbb script earlier in the script, but that has nothing to do with the error. The phpdebug says it's not a valid Mysql link resource at $result = mysql_query($string,$db_selected); Though I checked everything and all database/host settings are filled in correctly. Perhaps there is an error in the way I try to connect?
$string = "INSERT INTO 'hello' VALUES ('$gebruiker','1', '$today_plus_1_month','pictures','test.jpg');";
$con = mysql_connect("mysql3.***************","a3718717_members",$wachtwoord);
$db_selected = mysql_select_db('hello', $con);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$result = mysql_query($string,$db_selected);
if (!$result) {echo "Er is een fout opgetreden: $string :". mysql_error();}else{echo "1 record added";}
mysql_close($con);
}
?>