This is a bit of a weird one really, and probably something I haven’t done correctly, but for some reason when I am inserting or updating in MySQL (using a PHP Class to create), for some reason the text being inserted (an HTML copy of an email in this case) is only half inserted … it keeps breaking when it sees ‘–’
I do not think this is a standard hyphen since it looks ever so slightly different in the browser bar and even in this text area my hyphen ‘-‘ is narrower than ‘–’. I’ve tried HTML Entities, but will not convert, so an suggestions when dealing with this troublesome character?
Though I should probably say, if I use PHP My Admin to directly insert the HTML body (exactly the same formatting, everything gets inserted. I’ve even tried str_replace to remove it with no luck. I’ve also replaced words with a lot more words but that worked (yet it still cut off before that character showed…..
You are using a “dash” not to be confused with a hyphen. Look at the difference: – –
There are many kinds of dashes:
You can try to
str_replace("–", "-", $query);for each type before executing the query and see if that solves your problem, but really you should look into possibly doing a utf8_encode() and then setting your database field to use UTF8.