I'm working on a registration form in PHP and I'm wonder what the essential functions are to make sure my database is safe.
I'm sure there are a lot of ways to both protect your database or attack one, but I'm asking the advice of stackoverflow: what functions or things must you apply to your data before inserting it into the database.
Also, suppose I'm escaping the string "Karl D'Hondt", which becomes "Karl D\'Hondt", I'll need regex that takes the \ into account. Names don't normally contain such symbols. Or should I simply check for a ; symbol in all strings and filter those???
It's kinda confusing thinking of every single way you can try to prevent something. Which is why I'm asking here for the experience of veterans to help decide on a compact, but powerfull and versatile way of securing databases from the data that is sent via forms.