The statement is this:
$sql = "INSERT into ' {$table->column_list_page} ' set nid= ' {$_request[' NodeID '} ', title= ' {$_request[' Title ']} ', Author= ' {$_request[' Author '} ', content= ' {$_request[' Content ']} ', note= ' {$_request[' Note ']} ', editor= ' {$_session[ ' Adminuserinfo ' [' Auserid ']} ', Time= '. Time (). "'";
$db->query ($sql);}
There is no problem inserting several pages of characters when inserting more than 10 pages of documents copied from Word that cannot be inserted.
Help me!
Reply to discussion (solution)
In MySQL, directly put in, you can use, msyql no problem.
1, you directly use $_request data, it may be because the special characters are not escaped and cause insert failure
2, you may use the Text Type field, then the upper limit is 64k. More text is more likely to be overrun.
1, you directly use $_request data, it may be because the special characters are not escaped and cause insert failure
2, you may use the Text Type field, then the upper limit is 64k. More text is more likely to be overrun.
The database field uses the Mediumtext type and should not exceed the upper limit.
The first one you said, how do you not use $_request data directly, or how to escape it?
PHP Novice for help.
Post error messages for analysis
Echo Mysql_error ();
Post error messages for analysis
Echo Mysql_error ();
I am engaged in the ASP, PHP did not contact, this is to catch ducks on the car, the system before others do, there is no solution to this problem, I have to solve.
The main is to put the form in Word into fckeditor, and then into the database. Small, no problem, big problem comes.
Not afraid of your jokes, and will not use echo mysql_error ();
How to use?
$db->query ($sql);
Echo Mysql_error (); Post an error message
The program on the server, tomorrow added to ask
Any data that is inserted into MySQL from PHP is preferable to escape processing.
$str = isset ($_request[' str ')? Addslashes ($_request[' str '): ';
Any data that is inserted into MySQL from PHP is preferable to escape processing.
$str = isset ($_request[' str ')? Addslashes ($_request[' str '): ';
This is it, my php.ini set Magic_quotes_g=off, change to ON, it's OK.
View the information to know:
Addslashes (String) parameter description
string is required. Specifies the string to check.
Hints and Notes
Tip: This function can be used to prepare the appropriate string for strings stored in the database and for database query statements.
Note: By default, PHP instruction MAGIC_QUOTES_GPC is on, and automatically runs Addslashes () for all GET, POST, and COOKIE data. Do not use Addslashes () for strings that have been MAGIC_QUOTES_GPC escaped, because this results in double-layer escaping. You can use the function GET_MAGIC_QUOTES_GPC () to detect this situation.
Knot stickers, give points.