我收到了这个错误:
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
这是我的mysql查询代码:
$query = "INSERT INTO main SET title ='".$ttile."', url='".$url."',
kod='".$kod."', owner='".$owner."', tag='".$tag."', since='".$since."',
desc='".$desc."'";
$db->rq($query);
请帮助和非常感谢!
答案 0 :(得分:7)
答案 1 :(得分:1)
我认为DESC是一个保留词,试着用反引号来逃避它。
答案 2 :(得分:-1)
mysql_query("INSERT INTO main(title,url,kod,owner,tag,since,description) VALUES('$title','$url','$kod','$owner','$tag','$since','$desc')");