Reputation: 1884
I got this error :
Database problem occur, please try again later.
- Error in query: INSERT INTO main SET title ='', url='www.jerseymurah.com', kod='jerseymurah', owner='Hasbul Aqill', tag='jersey, football, world cup', since='Feb 2010', desc='ssfsfsfsfs'
- Error: 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 'desc='ssfsfsfsfs'' at line 1 (Error #1064)
- File: /home/yosh/domains/yosh.my/public_html/demo/admincp/tambah-save.php
and this is my mysql query code :
$query = "INSERT INTO main SET title ='".$ttile."', url='".$url."',
kod='".$kod."', owner='".$owner."', tag='".$tag."', since='".$since."',
desc='".$desc."'";
$db->rq($query);
Please help and thanks a lot!
Upvotes: 2
Views: 251
Reputation: 19380
mysql_query("INSERT INTO main(title,url,kod,owner,tag,since,description) VALUES('$title','$url','$kod','$owner','$tag','$since','$desc')");
Upvotes: -1
Reputation: 449813
DESC
is a reserved word in mySQL.
You need to put that field in backticks:
`desc`="..."
maybe consider renaming the field.
mySQL reserved words in the manual
Upvotes: 7