Page 1 sur 1

Comment sélectionner les champs non vide

Posté : 29 juin 2008, 22:38
par stefane321
Bonjour,

J'ai une bd qui me sert d'annuaire de contact.

Certains ont un email et d'autre non.

Je veux créer une requete pour envoyer des emails aceux qui ont un email.

Voici ma requete originale;

Code : Tout sélectionner

$sqlD = "select * from Ventes_gestion where type=2 order by id ASC";
Que dois-je ajouter pour sélectionner seleument les enregistrements dont le champ courriel contien quelque chose?

Merci!

Code : Tout sélectionner

CREATE TABLE `Ventes_gestion` ( `id` int(255) NOT NULL auto_increment, `nom_entreprise` varchar(255) NOT NULL default '', `services` text NOT NULL, `personne_contact` varchar(255) NOT NULL default '', `url_web` varchar(255) NOT NULL default '', `courriel` varchar(255) NOT NULL default '', `telephone` varchar(255) NOT NULL default '', `tel_sans_frais` varchar(255) NOT NULL default '', `telecopieur` varchar(255) NOT NULL default '', `adresse` text NOT NULL, `ville` varchar(255) NOT NULL, `code_postal` varchar(255) NOT NULL, `date_dernier_appel` date NOT NULL, `recall` int(1) NOT NULL, `date_de_rappel` date NOT NULL, `soumission_envoye` int(1) NOT NULL default '0', `message` text NOT NULL, `image` varchar(255) NOT NULL default '', `status` int(1) NOT NULL, `region_id` int(255) NOT NULL, `ville_id` int(255) NOT NULL, `soliciter_web` int(1) NOT NULL, `type` int(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=275 ;

Posté : 29 juin 2008, 22:41
par nelumbo
La condition IS NOT NULL