As stated earlier temporary tables will only last as long as the session is alive. If you run the code in a PHP script, the temporary table will be destroyed automatically when the script finishes executing. If you are connected to the MySQl database server through the MySQL client program, then the temporary table will exist until you close the client or manually destroy the table.
mysql> CREATE TEMPORARY TABLE employee( -> emp_name VARCHAR(50) NOT NULL -> , emp_age INT(11) NOT NULL DEFAULT
-> , emp_class int(11) NOT NULL DEFAULT
Query OK, 0 rows affected (0.00 sec)