Should apostrophe's be stored from a form into a database as ’ or as is '

If Im pasting articles into a database from another website do I need to convert the string on posting or leave them as it is.

Recommended Answers

All 4 Replies

Depends what method you are using. If you are using MySQLi or PDO, then parameter binding will take care of it.

Thanks Im using mysqli.
So if I bind paramaters it will take care of itself ?.

It's always best to sanitize input anyway, but when using binding the apostrophes aren't an issue.

How would I go about sanitizing ?.
Also a lot of earlier records in my database pre changing mysql to mysqli now show with weird symbols instead of apostrophe's any idea how to rectify that problem as below ?.

O�Shea

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.