rimie1
Invité n'ayant pas de compte PHPfrance
30 mars 2011, 10:53
voila les 2 tables ainsi que la requete, il me donne toutes les donnees dans la table chansons:
CREATE TABLE IF NOT EXISTS `albums` (
`ida` int(2) NOT NULL auto_increment,
`noma` varchar(200) collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`ida`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;
--
-- Dumping data for table `albums`
--
INSERT INTO `albums` (`ida`, `noma`) VALUES
(1, 'album1'),
(2, 'album2');
CREATE TABLE IF NOT EXISTS `chansons` (
`idc` int(2) NOT NULL auto_increment,
`ida1` int(2) NOT NULL,
`nomc` varchar(200) collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`idc`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;
--
-- Dumping data for table `chansons`
--
INSERT INTO `chansons` (`idc`, `ida1`, `nomc`) VALUES
(1, 1, 'chanson1'),
(2, 1, 'chanson2'),
(3, 1, 'chanson3'),
(4, 2, 'chanson4');
et la requete:
SELECT albums.ida, chansons.* FROM chansons, albums WHERE chansons.ida1 = albums.ida
resultat, toutes les lignes de chansons:
Showing rows 0 - 3 (4 total, Query took 0.0008 sec)