thedeejay
Messages postés74Date d'inscriptiondimanche 2 avril 2006StatutMembreDernière intervention23 juin 2010
-
28 janv. 2009 à 19:40
coucou747
Messages postés12303Date d'inscriptionmardi 10 février 2004StatutMembreDernière intervention30 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