it doesn't work. at least with the usual mysql/php configuration. the mysql_query function does not allow to send multiple SQL commands separated with a semicolon (😉 so there's no security hazard.
if you wanna be completely sure, check every user input (something you should do anyway) and remove or quote slashes, single- and double quotes and overlengthed strings.