U need to learn basic of PHP and Basic if Database so u know how they work..
because to hack website u need to find a weekness from a php code on a website..
some example :
so basic web vuln :
for a beginer on web developer many people doing change password using ther member ID or from cookies ( the best way is from session ).
you can change password and they throw your ID.
lets thinking they now validate if you change your id / cookies to change your id to be another user id.
then if you change password it will change other user id, not your id..
its just a simple case, but its not working ( but sometimes dumb people still missing to validate user id from session / validate current password)
CMIIW