Création de tables dans une boucle
Bonsoir,
Je souhaiterai créer des tables sql identiques (en structure) mais avec des noms différents.
J'ai pensé le faire à partir d'un script php mais j'ai une erreur (Parse error: syntax error, unexpected T_STRING in /mnt/159/sdb/6/7...) qui apparait.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| for($i=1; $i=200; $i++)
{
$nom = 'tome'.$i;
CREATE TABLE `$nom` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`evenement` text collate utf8_general_ci NOT NULL,
`variable` int(11) NOT NULL,
`delta` int(11) NOT NULL,
`temps` timestamp DEFAULT CURRENT_TIMESTAMP,
`bilan` varchar(30) collate utf8_general_ci NOT NULL,
PRIMARY KEY (`id`),
);
} |
Merci par avance de votre aide