Probleme requete Mysql

Résolu
thedeejay Messages postés 74 Date d'inscription dimanche 2 avril 2006 Statut Membre Dernière intervention 23 juin 2010 - 28 janv. 2009 à 19:40
coucou747 Messages postés 12303 Date d'inscription mardi 10 février 2004 Statut Membre Dernière intervention 30 juillet 2012 - 28 janv. 2009 à 22:47
Bonjour à tous!
j'ai un probleme lors de l'execution du script de création de mes bases de données:

alors mon script est:
<?php
mysql_connect($mysql_hote, $mysql_login, $mysql_pass);
mysql_select_db($mysql_base);


// on créé les tables dont on a besoin


$requete = "


CREATE TABLE `articles` (
  `id` int(11) NOT NULL auto_increment,
  `createur` text NOT NULL,
  `titre` text NOT NULL,
  `content` text NOT NULL,
  `cat` int(11) NOT NULL,
  `date` text NOT NULL,
  `tags` text NOT NULL,
  `status` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;


CREATE TABLE `comments` (
  `id` int(11) NOT NULL auto_increment,
  `pseudo` text NOT NULL,
  `message` text NOT NULL,
  `ip` text NOT NULL,
  `mail` text NOT NULL,
  `date` text NOT NULL,
  `article` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;


CREATE TABLE `comments_pages` (
  `id` int(11) NOT NULL auto_increment,
  `pseudo` text NOT NULL,
  `message` text NOT NULL,
  `ip` text NOT NULL,
  `mail` text NOT NULL,
  `date` text NOT NULL,
  `page` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;


CREATE TABLE `pages` (
  `id` int(11) NOT NULL auto_increment,
  `createur` text NOT NULL,
  `titre` text NOT NULL,
  `adresse` text NOT NULL,
  `content` text NOT NULL,
  `cat` int(11) NOT NULL,
  `date` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
";
mysql_query($requete) or die('erreur de sql'.$sql.'
'.mysql_error());


mysql_close(); ?>

et l'erreur affichée est:
 erreur de sql
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 'CREATE TABLE `comments` ( `id` int(11) NOT NULL auto_increment, `pseudo' at line 13

Merci beaucoup!

3 réponses

coucou747 Messages postés 12303 Date d'inscription mardi 10 février 2004 Statut Membre Dernière intervention 30 juillet 2012 44
28 janv. 2009 à 21:37
salut

tu dois faire un mysql_query par requete.
3
thedeejay Messages postés 74 Date d'inscription dimanche 2 avril 2006 Statut Membre Dernière intervention 23 juin 2010
28 janv. 2009 à 22:01
Merci (foutu PhpmuyAdmin qui ma généré ce foutu code)
0
coucou747 Messages postés 12303 Date d'inscription mardi 10 février 2004 Statut Membre Dernière intervention 30 juillet 2012 44
28 janv. 2009 à 22:47
clique sur reponse acceptee stp
0
Rejoignez-nous