razaksamad
05-08-2008, 06:12 AM
Hi,I am trying to create an update script for my mysql database but cant get the thing to work and recieved an error ::confused:
MySQL said:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(id, name, email) VALUES ('', 'Alias Mohdq', '')' at line 1
Heres the update script (update.php):
$submit=true;
if(isset($submit)){
mysql_connect("", "", "") or die(mysql_error());
mysql_select_db("super") or die(mysql_error());
$sender = $_GET['id'];
$message = $_GET['name'];
if( isset($message)&& $message !== '' ){
$rg_sql = mysql_query("UPDATE alumni (id, name) VALUES ('$sender', '$message')") or die(mysql_error());
}
}
MySQL said:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(id, name, email) VALUES ('', 'Alias Mohdq', '')' at line 1
Heres the update script (update.php):
$submit=true;
if(isset($submit)){
mysql_connect("", "", "") or die(mysql_error());
mysql_select_db("super") or die(mysql_error());
$sender = $_GET['id'];
$message = $_GET['name'];
if( isset($message)&& $message !== '' ){
$rg_sql = mysql_query("UPDATE alumni (id, name) VALUES ('$sender', '$message')") or die(mysql_error());
}
}