RE: Sessions and Temporary Tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I'm trying to create a temporary table through a query call in php and
> have no guiding documentation to refer to.  I assume it can be created
> as any other query call.  I would use CREATE INSERT but the insert
data
> is coming from a while loop.  I understand that the temporary table
> requires registration as a session to ensure it is dropped after the
> session is closed.  Does this mean I would need to simply register the
> name of the table.

You create a temporary table just like you would any other...

CREATE TEMPORARY TABLE table_name (id int, name varchar(20), ...
Or
CREATE TEMPORARY TABLE table_name SELECT ... FROM other_table

After it's created, within the same script _only_ you can do regular
INSERTS, UPDATES, SELECTS, whatever...

> All aspects of the code are apparently working fine.  No errors.  When
I
> use a SELECT statement and attempt to display the contents of the
table,
> I only get the html headers for the table but no data.  When I attempt
> to DESCRIBE the table directly from the mysql command line - it does
not
> exist.

If it's created from within your script, then you won't be able to see
if from the command line as the temporary table is specific to the
connection. The script and the command line are two different
connections and can't see each others temporary tables...

---John Holmes...



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux