Vous n'êtes pas identifié.
Pages: 1 2
pour sous -catégorie, est-ce que je dois fait un id_categorie pour lié la table catégorie à la table sous catégorie?
édite :voila mes tables:
-- -- Structure de la table `CATEGORIES` -- CREATE TABLE IF NOT EXISTS `CATEGORIES` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nom_categorie` text collate latin1_general_ci NOT NULL, `description_categorie` text collate latin1_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ; -- -- Contenu de la table `CATEGORIES` -- -- -------------------------------------------------------- -- -- Structure de la table `SOUS-CATEGORIES` -- CREATE TABLE IF NOT EXISTS `SOUS-CATEGORIES` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_categorie` int(11) NOT NULL, `nom_sous-categorie` text collate latin1_general_ci NOT NULL, `description_sous-categorie` text collate latin1_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ; -- -- Contenu de la table `SOUS-CATEGORIES` -- -- -------------------------------------------------------- -- -- Structure de la table `CONTENU` -- CREATE TABLE IF NOT EXISTS `CONTENU` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_sous-categorie` int(11) NOT NULL, `titre` text collate latin1_general_ci NOT NULL, `description` text collate latin1_general_ci NOT NULL, `texte` text collate latin1_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ; -- -- Contenu de la table `CONTENU` --
tu en penses quoi? c'est bizarre mais y a quelque chose qui me gêne.... 
Dernière modification par fleur69 (29-09-2011 20:37:42)
Hors ligne

Oui tu dois lier la table SOUS_CATEGORIES à la table CATEGORIES par un champ du style "id_categorie" et idem dans la table CONTENU qui doit contenir un champ du style "id_categorie" et "id_sous_categorie".
Ce qui me chagrine le plus, c'est la façon don tu nommes tes champs "id_sous-categorie", on ne met pas de tiret haut (-) dans le nom des champs ou tables.
Hors ligne
Pages: 1 2
Propulsé par PunBB
© Copyright 2007
Forum créer un site