salut j'ai cée une base de donnée mysql dans laquelle j'ai inseré ddes données . ensuite j'ai fait une requete sur la base de donnée mais je n'ai pas de resultat.
la page n'affiche pas de nom ni prenom et ne m'envoi pas de code d'erreur.
s'il vous plait je veux une aide .
merci d'avance .
voici mon code .
code :
<?php
$nom=trim($_POST["nom"]);
$prenom=trim($_POST["prenom"]);
$color=array('#333333','#999999');
$i=0;
$db = mysql_connect('localhost', 'root', '') or die(mysql_error());
mysql_select_db('go&ga',$db) or die(mysql_error());
$sql = "SELECT nom,prenom FROM utilisateurs WHERE privilege='admin' ORDER BY NOM ASC";
$req = mysql_query($sql) ;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Document sans titre</title>
<style type="text/css">
<!--
.Style3 {color: #FFFFFF}
.Style4 {color: #FFFFFF; font-weight: bold; }
.Style6 {
color: #FF00FF;
font-size: xx-large;
}
.Style7 {color: #999999}
-->
</style>
</head>
<body>
<div align="center">
<h1> </h1>
<table width="200" border="0" align="left">
<tr>
<td><span class="Style6">go&ga</span></td>
<td><a href="go&ga.php">acceuil</a></td>
</tr>
</table>
</div>
<div align="right"></div>
<p> </p>
<table width="1016" height="27" border="0">
<tr>
<td width="100"><img src="1.jpg"width="100" height="97" /></td>
<td width="100"><img src="2.jpg"width="100" height="97" /></td>
<td width="100"><img src="3.jpg" width="100" height="97" /></td>
<td width="100"><img src="4.jpg" width="100" height="97" /></td>
<td width="101"><img src="5.jpg" width="100" height="97" /></td>
<td width="101"><img src="6.jpg" width="100" height="97" /></td>
<td width="67"><img src="7.jpg" width="100" height="97" /></td>
<td width="50"><img src="8.jpg" width="100" height="97" /></td>
<td width="50"><img src="12.jpg" width="100" height="97" /></td>
<td width="57"><img src="11.jpg" width="100" height="97" /></td>
<td width="43"> </td>
<td width="71"> </td>
</tr>
</table>
<p> </p>
<table width="1013" height="27" border="0">
<tr>
<td width="173"> </td>
<td width="348"><span class="Style7">Tous</span></td>
<td width="116"> </td>
<td width="116"> </td>
<td width="116"> </td>
<td width="118"> </td>
</tr>
</table>
<table width="805" border="0" align="center" cellspacing="2">
<tr bgcolor="#999999">
<th width="174" scope="row"><span class="Style3">NOM</span></th>
<td width="205"><div align="center" class="Style4">PRENOM</div></td>
</tr>
<?php
while ($liste_etu=mysql_fetch_assoc($req)) {
$j=$i%2;
?>
<tr bgcolor="<?php echo $color[$j]; ?>">
<td><?php echo $liste_etu['nom'] ?></td>
<td><?php echo $liste_etu['prenom'] ?></td>
</tr>
<?php
$i++;
}
?>
salut j'ai cée une base de donnée mysql dans laquelle j'ai inseré ddes données . ensuite j'ai fait une requete sur la base de donnée mais je n'ai pas de resultat.
la page n'affiche pas de nom ni prenom et ne m'envoi pas de code d'erreur.
s'il vous plait je veux une aide .
merci d'avance .
voici mon code .
code :
<?php
$nom=trim($_POST["nom"]);
$prenom=trim($_POST["prenom"]);
$color=array('#333333','#999999');
$i=0;
$db = mysql_connect('localhost', 'root', '') or die(mysql_error());
mysql_select_db('go&ga',$db) or die(mysql_error());
$sql = "SELECT nom,prenom FROM utilisateurs WHERE privilege='admin' ORDER BY NOM ASC";
$req = mysql_query($sql) ;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Document sans titre</title>
<style type="text/css">
<!--
.Style3 {color: #FFFFFF}
.Style4 {color: #FFFFFF; font-weight: bold; }
.Style6 {
color: #FF00FF;
font-size: xx-large;
}
.Style7 {color: #999999}
-->
</style>
</head>
<body>
<div align="center">
<h1> </h1>
<table width="200" border="0" align="left">
<tr>
<td><span class="Style6">go&ga</span></td>
<td><a href="go&ga.php">acceuil</a></td>
</tr>
</table>
</div>
<div align="right"></div>
<p> </p>
<table width="1016" height="27" border="0">
<tr>
<td width="100"><img src="1.jpg"width="100" height="97" /></td>
<td width="100"><img src="2.jpg"width="100" height="97" /></td>
<td width="100"><img src="3.jpg" width="100" height="97" /></td>
<td width="100"><img src="4.jpg" width="100" height="97" /></td>
<td width="101"><img src="5.jpg" width="100" height="97" /></td>
<td width="101"><img src="6.jpg" width="100" height="97" /></td>
<td width="67"><img src="7.jpg" width="100" height="97" /></td>
<td width="50"><img src="8.jpg" width="100" height="97" /></td>
<td width="50"><img src="12.jpg" width="100" height="97" /></td>
<td width="57"><img src="11.jpg" width="100" height="97" /></td>
<td width="43"> </td>
<td width="71"> </td>
</tr>
</table>
<p> </p>
<table width="1013" height="27" border="0">
<tr>
<td width="173"> </td>
<td width="348"><span class="Style7">Tous</span></td>
<td width="116"> </td>
<td width="116"> </td>
<td width="116"> </td>
<td width="118"> </td>
</tr>
</table>
<table width="805" border="0" align="center" cellspacing="2">
<tr bgcolor="#999999">
<th width="174" scope="row"><span class="Style3">NOM</span></th>
<td width="205"><div align="center" class="Style4">PRENOM</div></td>
</tr>
<?php
while ($liste_etu=mysql_fetch_assoc($req)) {
$j=$i%2;
?>
<tr bgcolor="<?php echo $color[$j]; ?>">
<td><?php echo $liste_etu['nom'] ?></td>
<td><?php echo $liste_etu['prenom'] ?></td>
</tr>
<?php
$i++;
}
?>