I understand temporary table S are dropped automatically. but are the table S which are created unique? I. e. shocould I create a different name for the table or does mysql sort this out?
CreateTemporary TableTemp1 type = heap select * from MERs
.
.
PHP Database Report stuff here ....
.
.
DropTemporary TableTemp1
This createsTemporary TableCalled temp1 and is populated from MERs.
1. What happens if 2 users run the code at near the same time? Will the temp1TableBe upted?
2. What happens if 1 user fires up 2 browser windows and runs the script at near the same time?
3. Is it really necessary to dropTableAt the end of the Code.MySQLSays thatTemporary TableS are automatically dropped.
I cocould create a random name rather than temp1 that shocould sort it?
Note that the type = heap doesn't really matter here. The same problem shoshould exist if heap or not: Does creatingTemporary TableCreate temp1 in seperate user space?
----------------------------------------------------------------------------------
Frank,
This is what I got from mysql docs:
" A temporary table will automatically be deleted if a connection dies and the name is per connection. this means that two different connections can both use the same temporary table name without conflicting with each other or with an existing table of the same name. (The existing table is hidden until the temporary table is deleted .) "
so this means you can safely use any name for your temporary table .