dimanche 12 juin 2016

MySQL can't create temporary table

I have a very large table that I need to do a number of queries on. I'd like to create a temporary file that would be about 20 times smaller to work with. Although I've seen this code as an example in many places it just does nothing for me. The user has create and create temporary enabled in privileges. The errorInfo is clean. $outcome is false. I've also tried it with and without the 'AS' placed before the SELECT. It just does nothing. Other prepared statements on that database and table work just fine.

 $at = $db->prepare("CREATE TEMPORARY TABLE `access-temp` AS
         (SELECT * FROM `access-log` WHERE `domain` = 'myDomain.com')");
 $outcome = $at->execute();
 print_r($db->errorInfo());

Aucun commentaire:

Enregistrer un commentaire