<?php
$dbhost="localhost";
$dblogin="root";
$dbpassword="";
$dbname="intranet";
//recupere le contenu du champs du fichier MenuSql.php
$nom = $_GET["liste1"];
//requete qui teste l existance du nom dans la base de donnée Mysql
mysql_connect($dbhost,$dblogin,$dbpassword);mysql_selectdb($dbname);
$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' from utilisateurs util,site,service serv,societe soci where util.site = site.id_site and util.service = serv.id_service and util.societe = soci.id_societe" );
print "nom=$nom ";
print"<br><hr>\n";
print " <center>Liste téléphonique triée par <b>site</b> </center>\n";
print"<br><hr><br>\n";
print "<table border=1 table bordercolor=blue width=800 height=20>\n";
print "<TR>\n" ;
print "
<TD width=100>Nom</TD>\n
<TD width=80>Prénom</TD>\n
<TD width=160>Fonction</TD>\n
<TD width=40>Tél</TD>\n
<TD width=80>Site</TD>\n
<TD width=100>Société</TD>\n
<TD width=120>Service</TD>\n
<TD width=200>Mail</TD>\n";
print "</TR>\n";
while($row = mysql_fetch_array($sql_results))
{ print "<table border=1 table bordercolor=green width=800 height=20>\n";
print "<TR>\n" ;
print "
<TD width=100>".$row['nom']. "</TD>\n
<TD width=80>".$row['prenom']. "</TD>\n
<TD width=160>".$row['fonction']. "</TD>\n
<TD width=40>".$row['telephone']. "</TD>\n
<TD width=80>".$row['site']. "</TD>\n
<TD width=100>".$row['societe']. "</TD>\n
<TD width=120>".$row['service']. "</TD>\n
<TD width=200>".$row['mail']. "</TD>\n";
print "</TR>\n";
}
mysql_close();
?>
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp\www\reponsesite.php on line 36
j ai mit en grasla ligne
pour info $nom renvoie lisses
Message édité par sakuraba le 06-12-2002 à 14:27:55