Help! PHP mysql Insert long string does not insert the problem.
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!
Share to:
------Solution--------------------
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.
------Solution--------------------
$db->query ($sql);
Echo Mysql_error (); Post an error message
------Solution--------------------
Any data that is inserted into MySQL from PHP is preferable to escape processing.
$str = isset ($_request[' str ')? Addslashes ($_request[' str '): ';