0

私はこのクエリを持っています。再び pop3 アカウントから mysql データベースに渡そうとしています:

mysqli_query($con,"INSERT INTO procesa_emails (body_mail, uid_message, fecha, from, to, subject, message_id) VALUES ('".mysqli_real_escape_string($con,htmlentities(str_replace("'","",str_replace('"','',$message))))."','".mysqli_real_escape_string($con,htmlentities($uid_mess))."','".mysqli_real_escape_string($con,htmlentities($fecha))."','".mysqli_real_escape_string($con,htmlentities($from))."','".mysqli_real_escape_string($con,htmlentities($to))."','".mysqli_real_escape_string($con,htmlentities($subject))."','".mysqli_real_escape_string($con,htmlentities($mui))."')")or die(mysqli_error($con));

しかし、それは私を返します:

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 'from, to, subject, message_id) 

str_replace("'","",str_replace('"'.'')) で試しましたが、動作しません

4

1 に答える 1

1

FROM予約キーワードです。したがって、クエリ内でそれを使用する場合は、次のようにバッククォートでラップする必要があります。

mysqli_query($con,"
INSERT INTO procesa_emails (body_mail, uid_message, fecha, `from`, ...

お役に立てれば!

于 2013-07-24T21:03:30.393 に答える