You need to use [man]mysql_query/man to run queries using the MySQL API. Just writing them directly in the PHP code will not work.
Incidentally, I suggest using the MySQLi extension or PDO extension instead of this old MySQL extension. For one thing, they have support for prepared statements.