Possible Duplicate:
Best way to stop SQL Injection in PHP
Recently, I got my database wiped through a hacker inserting a DROP table
command through a signup form.
This annoyed me and got me thinking:
How can I prevent mysql injection in php, before the information is sent to the database, e.g is there a way to detect that the user is trying to inject bad code into the database that can wipe it, and if so, detect it and display an error?
Also, is there a way to detect the mysql injection after it has been added, so when I am displaying the query, if it is the delete injection code, don't display it.
Thanks again, I apologise for any waffle.