Hint: Never, ever use the internal PHP SQL functions. Never.
Either use another language, or get one of the database access modules for PHP. You will find a thousand tutorials and guides to using the internal PHP mysql_*
functions, but do not use them. They are horribly broken and you will write insecure code using them.