Voici ma DB :
Code : Tout sélectionner
CREATE TABLE `tuks_avertissement` (
`id` mediumint(9) NOT NULL auto_increment,
`type_user` tinyint(4) NOT NULL,
`user` text collate latin1_general_ci NOT NULL,
`motif` mediumint(9) NOT NULL,
`description` text collate latin1_general_ci NOT NULL,
`type` tinyint(4) NOT NULL,
`date` bigint(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=6 ;
--
-- Contenu de la table `tuks_avertissement`
--
INSERT INTO `tuks_avertissement` (`id`, `type_user`, `user`, `motif`, `description`, `type`, `date`) VALUES
(1, 1, '3', 1, 'test d''HTML : <strong>gras</strong>', 1, 0),
(2, 1, '3', 2, 'test d''HTML : <strong>gras</strong>', 1, 0),
(3, 1, '3', 3, 'test d''HTML : <strong>gras</strong>', 2, 3),
(4, 1, '3', 3, 'test d''HTML : <strong>gras</strong>', 3, 0),
(5, 1, '1', 1, '', 3, 0);
Sachant que :
type = 1 : Avertissement
type = 2 : Ban temporaire
type = 3 : Ban définitif
user = 1 : Rem73
user = 3 : Compte test
J'ai penser à faire un GROUP BY user, mais après je ne sais pas comment compter séparément les entrées avec un "type = 1", "type = 2" et "type = 3".
Merci d'avance