In PHP when submitting strings to the database should I take care of illegal characters using htmlspecialchars() or use a regular expression?

There are no “illegal” characters for the database. Database that cannot store some characters is a nonsense. There are some service characters, like quotes, used to delimit strings. These characters should be just escaped, not eliminated. To send a query to the database, you have 2 options: Build a query usual way, to make it … Read more