I am getting an error with a query similar to this, but I have not figured out the problem:
$str = "rob's";
...
$query ="INSERT INTO tableName (name) VALUES (mysql_real_escape_string('$str')";
Edit:
I apologize. I made a mistake while reducing my code down; this is closer to what I have that is giving an error:
$str = "rob's";
...
$query ="INSERT INTO tableName (name) VALUES (('".mysql_real_escape_string($str)."')";
mysql_functions and switch to a library that offers parameterized queries, e.g. PDO.VALUES(('".mysql_real_escape_string($str)."')should be likeVALUES ('".mysql_real_escape_string($str)."'). Isn't it?