You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'TYPE=MyISAM\' at line 8 SQL=CREATE TABLE jos_hp_temp (\n id INT(11) NOT NULL, \nname MEDIUMTEXT NOT NULL, \ntype MEDIUMTEXT NOT NULL, \ndistrict MEDIUMTEXT NOT NULL, \ntype2 MEDIUMTEXT NOT NULL, \nPRIMARY KEY (id)\n) TYPE=MyISAM ;Table \'dream_propertyhub.jos_hp_temp\' doesn\'t exist SQL=INSERT INTO jos_hp_temp (`id`, `name`, `type`, `district`) \n SELECT p.id, p.name, p.type, p.district\n FROM (jos_hp_properties AS p, jos_hp_companies AS c)\n LEFT JOIN jos_hp_prop_types AS t ON p.type = t.id\n LEFT JOIN jos_hp_agents AS a ON p.agent = a.id\n WHERE p.published=\'1\' AND p.approved=\'1\' AND t.published=\'1\'\n AND a.company=c.id\n AND (publish_up = \'0000-00-00 00:00:00\' OR publish_up <= \'2016-12-06 13:02:17\')\n AND (publish_down = \'0000-00-00 00:00:00\' OR publish_down >= \'2016-12-06 13:02:17\')