Some records UPDATE but some won't
Posted: Thu Mar 17, 2011 2:02 pm
I have a MySQL table that contains many records that came from a previous project. I am finding that some, but not all, of the original records cannot be updated. I have not been able to figure out what the difference is. I have tried using mysql_real_escape_string and htmlentities to make the records palatable to MySQL. Many of the columns come from textareas managed by TinyMCE. Some of the original content was pasted from MSWORD, yet it all got inserted into the database originally. The form I am using is only accessed in a password protected area, so I'm not concerned about malicious injections.
Here is the code I am using to cleanup the datab before inserting:
foreach ($_POST as $k=>$v){
$v = htmlentities($v, ENT_QUOTES, "UTF-8");
$v = mysql_real_escape_string($v);
}
Any ideas?
Here is the code I am using to cleanup the datab before inserting:
foreach ($_POST as $k=>$v){
$v = htmlentities($v, ENT_QUOTES, "UTF-8");
$v = mysql_real_escape_string($v);
}
Any ideas?