Please look at the sample code
mysql_query('SET AUTOCOMMIT=0;');
mysql_query('START TRANSACTION;');
$tableName = rand().'_table;'
$this->loadModel('Home'); // Model for homes_table
$sql = 'CREATE TABLE '.$tableName.'_table LIKE homes_table';
mysql_query($sql);
// FEW INSERT STATEMENTS ON THE NEW TABLE $tableName //
/*
Here I want to paginate the new table
using $this->paginate();
HOW?
*/
mysql_query('TRUNCATE table '.$tableName);
mysql_query('COMMIT;');
I want to paginate the new table created? Logic is each time a person runs the script a new random named table will be created -> then paginated -> then droped ... Or how do I assign Model to dynamically created tables in cakePHP.
its sounds like what you are doing is bad. Besides that you should not be calling things like CREATE TABLE, TRUNCATE, COMMIT etc.
Look at the sest suite for how to properly create and delete tables, read the api on how to do transactions. things like http://api13.cakephp.org/class/data-source#method-DataSourcebegin
also the table name should be plural for cake to be able to do this auto, so your example would not work.
You can get a instance of the model by doing