This is my code..
$sql = "INSERT INTO template (file,file_ext, file_size, file_data,tarikh_kemaskini) ";
$sql.= "VALUES (";
$sql.= "'{$file}', '{$file_ext}', '{$file_size}', '{$file_data}','{CURDATE()}' WHERE id='$id'";
Error occur said like this :
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 'WHERE id='1'' at line 1
The error maybe at WHERE id='$id'"; syntax and how to overcome this problem??
Help me.....
Somebody...i need some help
Moderator: General Moderators
Re: Somebody...i need some help
Look at your query. Just, look at it. If you look hard enough you'll see the problem.
Re: Somebody...i need some help
I feel sorry for a first-time poster, so I'll point out that it doesn't make any sense to have a WHERE clause in an INSERT query.
Re: Somebody...i need some help
You're also missing a closing parentheses..