Php beginner simple message board questions about php beginner help Simple Message Board questions
This is the source code
It seems that the database can be connected, but it cannot be updated to the database.
The database is very simple. The field type sorting attribute is empty. Additional operations are performed by default.
The field has two names and pass
Hope you can come and see
------ Solution --------------------
"Insert into 'test _ db'. 'form' ('name', 'pass') VALUES (\ 'fdgsdfg \ ', \ 'dsfgsdfg \');"
First, because this string is enclosed in double quotation marks, it does not conflict with single quotation marks, so \ escape is not allowed.
You do not need to end with a semicolon. Because mysql_query () itself only sends one query statement to mysql at a time.
Modified code:
$ SQL = "INSERT INTO 'test _ db '. 'form' ('name', 'pass') VALUES ('fdgsdfg', 'dsfg') "; mysql_query ($ SQL, $ con) or exit (mysql_error ()); // This is the focus and it will tell you why the error occurred.