USE INFORMATION_SCHEMA; SELECT CONCAT("ALTER TABLE ", TABLE_SCHEMA ,".", TABLE_NAME, "ENGINE=MEMORY;") AS MySQLCMD FROM TABLES WHERE TABLE_SCHEMA = "MA_BASE";
Liste tous les champs d’une table dans un tableau PHP
USE INFORMATION_SCHEMA; SELECT CONCAT('$variable["', COLUMN_NAME ,'"]') FROM COLUMNS WHERE TABLE_SCHEMA = "mabase" AND TABLE_NAME='matable';