The age old problem and question.
In my database I have some fields that have single quotes.
Such as the word it's.
Using "insert into" and strings for the values, one must quote the stings.
Using values("$string") causes the field to contain the data as $string. Not the desired string.
As I pull the data from one table, I may have something like "It's late".
This causes the actual value to show -> Values('it's late').
This is what generates the error because of the mismatch of quotes.
I tried using addslashes(), that changed nothing.
I tried manually editing the database, no change.
So what is the proper solution to this?