I have a PHP script which makes users able to search my databases. For these searches, I combine the data in a temporary table.
Let's say I have the following situation:
- User 1 starts searching at 11:12:20 and the search takes 5 seconds to perform
- User 2 starts searching at 11:12:24
This means that the temporary table, created for the search of user 1 is still active when user 2 starts to search. Let's say I have a 'solid / hardcoded' script which just states the name of the temporary table as TempTable.
Will the situation occur that the Temporary Table named TempTable can't be created because for User 2, because User 1 is still using it? Or is MySQL smart enough to assign a Temporary Table to a session?
So my question in short is: what is the scope of a temporary table?