swa66 - 7:40 am on Jan 18, 2013 (gmt 0)
The vast majority of tutorials out there blatantly ignore security issues - actually I've to see the first one that's not specifically teaching security to show the right way to do things.
So remember that you're likely being thought how to handle a gun without any gun safety instructions at all.
That said, using the mysql interface is obsolete, it is replaced by mysqli (note the i). When learning things, I'd consider to skip mysql and move to mysqli immediately. That way you gain access to prepared statements and can solve security issues much more effectively than by trying to escape it all.