데이터베이스에 삽입 할 때 오류가 있습니다.PHP SQL 삽입 오류
코드 :
dbquery("INSERT INTO site_news_comments (articleid,title,short,comment,timestamp,userid,main,type,topstory) VALUES ($article,'".clean($commentss['title'])."','','".mysql_real_escape_string($_POST['comment'])."',current_timestamp,'".USER_ID."','0','".$commentss['type']."','')");
가 dbquery 무시는 상 mysql_query로 정확하게 작동합니다. 내가 수신하고
오류 :이 오류가 발생하는 이유
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 ''title','short','
없음 아이디어!
왜 모든 데이터를 먼저 변수에 넣지 않습니까? 나중에 INSERT하는 것이 훨씬 더 쉽습니다. 예 : $ title = clean ($ commentss [ 'title']) – s3polz
쿼리를 인쇄하고 실행하기 전에 빌드를 확인하십시오. – Deepak