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.