$site = $_GET["site"];
$service = $_GET["service"];
$societe = $_GET["societe"];
mysql_connect($dbhost,$dblogin,$dbpassword);mysql_selectdb($dbname);
if ($site = 'Tous' and $service = 'Tous' and $societe = "Tous" ) {
$sql_results=mysql_query("select util.nom as 'nom',util.prenom as 'prenom',util.fonction as 'fonction',
site.nom as 'site',serv.nom as 'service',soci.nom as 'societe',util.mail 'mail',util.telephone 'telephone'
from utilisateurs util,site,service serv,societe soci
where util.id_site = site.id_site and util.id_service = serv.id_service and
util.id_societe = soci.id_societe order by nom" );
//compter le nbre de reponse trouvée
$result_count=mysql_num_rows($sql_results);
}
elseif ($site = 'Tous' and $service = 'Tous'{
$sql_results=mysql_query("select util.nom as 'nom',util.prenom as 'prenom',util.fonction as 'fonction',
site.nom as 'site',serv.nom as 'service',soci.nom as 'societe',util.mail 'mail',util.telephone 'telephone'
from utilisateurs util,site,service serv,societe soci
where util.id_site = site.id_site and util.id_service = serv.id_service and
util.id_societe = soci.id_societe and soci.nom='$societe' order by nom" );
}
elseif ($site = 'Tous' and $societe = 'Tous'{
$sql_results=mysql_query("select util.nom as 'nom',util.prenom as 'prenom',util.fonction as 'fonction',
site.nom as 'site',serv.nom as 'service',soci.nom as 'societe',util.mail 'mail',util.telephone 'telephone'
from utilisateurs util,site,service serv,societe soci
where util.id_site = site.id_site and util.id_service = serv.id_service and
util.id_societe = soci.id_societe and serv.nom='$service' order by nom" );
}
elseif ($societe = 'Tous' and $service='Tous'{
$sql_results=mysql_query("select util.nom as 'nom',util.prenom as 'prenom',util.fonction as 'fonction',
site.nom as 'site',serv.nom as 'service',soci.nom as 'societe',util.mail 'mail',util.telephone 'telephone'
from utilisateurs util,site,service serv,societe soci
where util.id_site = site.id_site and util.id_service = serv.id_service and
util.id_societe = soci.id_societe and serv.nom='$site' order by nom" );
}
elseif ($service = 'Tous' and $societe = 'Tous'{
$sql_results=mysql_query("select util.nom as 'nom',util.prenom as 'prenom',util.fonction as 'fonction',
site.nom as 'site',serv.nom as 'service',soci.nom as 'societe',util.mail 'mail',util.telephone 'telephone'
from utilisateurs util,site,service serv,societe soci
where util.id_site = site.id_site and util.id_service = serv.id_service and
util.id_societe = soci.id_societe and serv.nom='$site' order by nom" );
}
elseif ($service = 'Tous'{
$sql_results=mysql_query("select util.nom as 'nom',util.prenom as 'prenom',util.fonction as 'fonction',
site.nom as 'site',serv.nom as 'service',soci.nom as 'societe',util.mail 'mail',util.telephone 'telephone'
from utilisateurs util,site,service serv,societe soci
where util.id_site = site.id_site and util.id_service = serv.id_service and
util.id_societe = soci.id_societe and serv.nom='$site' and soci.nom='$societe' and order by nom" );
}
elseif ($societe = "Tous" ){
$sql_results=mysql_query("select util.nom as 'nom',util.prenom as 'prenom',util.fonction as 'fonction',
site.nom as 'site',serv.nom as 'service',soci.nom as 'societe',util.mail 'mail',util.telephone 'telephone'
from utilisateurs util,site,service serv,societe soci
where util.id_site = site.id_site and util.id_service = serv.id_service and
util.id_societe = soci.id_societe and serv.nom='$site' and serv.nom='$service' and order by nom " );
}
elseif ($site = "Tous" ){
$sql_results=mysql_query("select util.nom as 'nom',util.prenom as 'prenom',util.fonction as 'fonction',
site.nom as 'site',serv.nom as 'service',soci.nom as 'societe',util.mail 'mail',util.telephone 'telephone'
from utilisateurs util,site,service serv,societe soci
where util.id_site = site.id_site and util.id_service = serv.id_service and
util.id_societe = soci.id_societe and soci.nom='$societe' and serv.nom='$service' and order by nom " );
}
else{
$sql_results=mysql_query("select util.nom as 'nom',util.prenom as 'prenom',util.fonction as 'fonction',
site.nom as 'site',serv.nom as 'service',soci.nom as 'societe',util.mail 'mail',util.telephone 'telephone'
from utilisateurs util,site,service serv,societe soci
where util.id_site = site.id_site and util.id_service = serv.id_service and
util.id_societe = soci.id_societe and soci.nom='$societe' and serv.nom='$service' and serv.nom='$site' and order by nom " );
}
//requete qui teste l existance du nom dans la base de donnée Mysql
ca fait que la premiere condition ds tous les cas
J ai besoin d aide merci