But if you want to go even more professional -- use ORM
by YuriyHorobey: typos
If I were you I'd add an email confirmation script. Once the user registers, the users table is updated with the id, but an additional field called confirmed is set to 0 (meaning NO). It is only set to 1 (YES) when the user replies to the email by pressing a link contained within. Otherwise, you may be bombarded with spammers and other flavours of magic carpet idiot.
This is quite easy to do - just build a confirm key - which can be made from a hash of email and id, e.g.