$content=addslashes($content); $sql=$akun->query("INSERT INTO pw_posts (fid,tid,author,authorid,postdate,userip,ifsign,ipfrom,ifcheck,content) VALUES ('$fid','$tid','".addslashes($author)."','$authorid','$postdate','$onlineip','1','$ipfrom','1','$content')");
搞了一个入库PW的采集,碰到'这样的符号就会出错,不知道这个写记录的SQL语句哪里没有搞好。。以下是出错信息:
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 't cry)(Easy) 80bpm 16:朴相民 不要哭(Don't cry)(Hard) 160bp
只要包含'的内容都会出错,还请指点一下。。主要是content这个字段,我加了addslashes了,不知道到低要怎么搞,还请各位指点一二。谢谢!
|