par
H@D3S » 17 sept. 2008, 00:21
Bonjour a tous,
Je suis actuellement entrain de créer un script et j aurait voulus lier deux tables dans ma base de données, mais je ne sait pas comment faire.
Pourriez vous m' aidez ?
Exposition :
1 table series
1 table series_episode
Contenue de ma table series :
Code : Tout sélectionner
CREATE TABLE `series` (
`id` int(11) NOT NULL auto_increment,
`nom` varchar(255) NOT NULL default '',
`description` text NOT NULL,
`image` varchar(255) NOT NULL default '',
`nb_clique` int(11) NOT NULL default '0',
`derniere_modif` bigint(20) NOT NULL default '0',
`cat` text NOT NULL,
`sai` text NOT NULL,
`auteur` text,
`auteur_id` varchar(20) NOT NULL default '',
`date` varchar(30) NOT NULL default '',
`bbcodeoff` int(1) NOT NULL default '0',
`smileyoff` int(1) NOT NULL default '0',
`realisateur` text NOT NULL,
`comedien` text NOT NULL,
`format` text NOT NULL,
`genre` text NOT NULL,
`nationalite` text NOT NULL,
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=69 ;
Contenue de ma table series_episode :
Code : Tout sélectionner
CREATE TABLE `nuked_series_episode` (
`id` int(11) NOT NULL auto_increment,
`nom` varchar(60) NOT NULL default '',
`duree` text,
`deconseille` text,
`saison` text,
`nombre` text,
`partun` text,
`partdeux` text,
`parttrois` text,
`partquatre` text,
`partcinq` text,
PRIMARY KEY (`id`),
KEY `nom` (`nom`)
) TYPE=MyISAM;
Donc enfaîte via l administration on peut ajouté une série et un épisode mais séparément, moi je voudrait que l on puisse ajouté un ou plusieurs épisode a une série.
J' espère avoir donner assez d'explication
Pourriez vous me dire comment je doit faire pour arriver a ce résultat ? svp....

Bonjour a tous,
Je suis actuellement entrain de créer un script et j aurait voulus lier deux tables dans ma base de données, mais je ne sait pas comment faire.
Pourriez vous m' aidez ?
Exposition :
1 table series
1 table series_episode
Contenue de ma table series :
[code]CREATE TABLE `series` (
`id` int(11) NOT NULL auto_increment,
`nom` varchar(255) NOT NULL default '',
`description` text NOT NULL,
`image` varchar(255) NOT NULL default '',
`nb_clique` int(11) NOT NULL default '0',
`derniere_modif` bigint(20) NOT NULL default '0',
`cat` text NOT NULL,
`sai` text NOT NULL,
`auteur` text,
`auteur_id` varchar(20) NOT NULL default '',
`date` varchar(30) NOT NULL default '',
`bbcodeoff` int(1) NOT NULL default '0',
`smileyoff` int(1) NOT NULL default '0',
`realisateur` text NOT NULL,
`comedien` text NOT NULL,
`format` text NOT NULL,
`genre` text NOT NULL,
`nationalite` text NOT NULL,
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=69 ;
[/code]
Contenue de ma table series_episode :
[code]CREATE TABLE `nuked_series_episode` (
`id` int(11) NOT NULL auto_increment,
`nom` varchar(60) NOT NULL default '',
`duree` text,
`deconseille` text,
`saison` text,
`nombre` text,
`partun` text,
`partdeux` text,
`parttrois` text,
`partquatre` text,
`partcinq` text,
PRIMARY KEY (`id`),
KEY `nom` (`nom`)
) TYPE=MyISAM;
[/code]
Donc enfaîte via l administration on peut ajouté une série et un épisode mais séparément, moi je voudrait que l on puisse ajouté un ou plusieurs épisode a une série.
J' espère avoir donner assez d'explication :D
Pourriez vous me dire comment je doit faire pour arriver a ce résultat ? svp.... :D