I'm having some problems with creating a temporary table with PHP. The code is:
$query_create_temp = "CREATE TEMPORARY TABLE IF NOT EXISTS temp
(
quantity smallint(4) not null default '0.00',
part_no varchar(20) not null default ' ',
part_description varchar(60) not null default ' ',
price_1_9 float(6,2) not null default '0.00'
)";
mysql_query($query_create_temp) or die("Could not run query_create_temp. ". mysql_error());
I've observed the following:
I can remove the word 'temporary' from the code above and the table is created. I can add, update and delete records in said table.
I can create a temporary table in SQL (using SQLyog) and perform add, update and delete functions, so it would seem temporary table permissions aren't a problem.
The interesting thing is that when the table creation code executes that no error message is returned. Further, I can add a record and no error message is returned. However, when I try to update a record I get "Table 'database.temp' doesn't exist". Remember, all of this code works fine until the word 'temporary' is added.
Does anyone have any ideas?