mysql_query("INSERT INTO Account(User,
Pw, email)
VALUES('mysql_real_escape_string($_POST[user])',
'$pw','mysql_real_escape_string($_POST[email])
) ") or die(mysql_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 ''mysql_real_escape_string(123))' at line 1
문제는 당신이 PHP 명령을 인용하고 있다는, 그래서는 결코 전달되지됩니다
은 달리 말하면 이것은 MySQL을 전달지고 쿼리입니다 ','mysql_real_escape_string ($ _ POST [email])) ... ... 그리고 그것은 유효한 MySQL 쿼리가 아닙니다 (PHP 함수를 포함하고 있습니다). 이 대답은 문제를 해결합니다. 나는 궁금하지만, $ pw도 이스케이프해야합니까? – TehShrike