This might sounds stupid but is it possible to create temporary table/database using Zend Framework and Mysql? If it is possible, may I have a sample code? Thanks
3 Answers
In Mysql, you can create temporary table with engine BLACKHOLE
It creates tables on the fly, means it will only be available upto one HTTP request, and on completing it will be deleted.
CREATE TABLE table_name engine = BLACKHOLE;
I don't know how to do in Zend, but may be something like this would help:
$db->execute("CREATE TABLE table_name engine = 'BLACKHOLE'");
2 Comments
txyoji
Blackhole engine does not save data, even for a single request. dev.mysql.com/doc/refman/5.0/en/storage-engines.html
Kalpesh
It will hold the data temporarily during the query. It don't store it there permanently.