Actually, you probably won't have your database erased by sql injection because that requires query stacking. PHP's mysql_query() will only accept 1 query at a time. I suspect you read something about M$-SQL which is a very different beast. You would know this if you have tried to exploit a sql injection vulnerability.
It is absolutely impossible to fully understand secuirty until you have written an exploit. It is impossible to test any patch without attempting to exploit it. It is impossible to prove that anything is secure unless you have tried to break it. Thinking that you know what is secure is far more damaging than someone who knows they don't know.
So how do hackers exploit software? The first thing a hacker is going to do is test the target for vulnerabilities. Make sure you run testing tool like Acunetix's free xss tester or better yet a full test like Wapiti. Make sure your php configuration is locked down with PHPSecInfo. And of coarse familiarize yourself with the OWASP top 10.