Check if a temporary table exists and delete if it exists before creating a temporary table?

I am using the following code to check if the temporary table exists and drop the table if it exists before creating...

How can I simulate an array variable in MySQL??

It appears that MySQL doesn't have array variables. What should I use instead? There seem to be two alternatives...