Some records UPDATE but some won't

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
rhecker
Forum Contributor
Posts: 178
Joined: Fri Jul 11, 2008 5:49 pm

Some records UPDATE but some won't

Post by rhecker »

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?
Post Reply