Afficher un table sql
iris
-
iris -
iris -
Bonjour,
bon salut à tous ..
j'ai un probleme daffichage j'ai créer ma base et 2 TABLEAU pour un forum
linsertion dans ces tableux bien effectuée
mais lorsque je les affiche rien à retourn !!
voici le script
bon salut à tous ..
j'ai un probleme daffichage j'ai créer ma base et 2 TABLEAU pour un forum
linsertion dans ces tableux bien effectuée
mais lorsque je les affiche rien à retourn !!
voici le script
// Connect to server and select databse.
$id_connexion=mysql_connect('localhost','root','') or die('Probl? de connexion au serveur MYSQL!');
mysql_select_db('base',$id_connexion) or die('Probl? de selection de la base de donn?!');
$sql="SELECT * FROM $tbl_name ORDER BY id DESC";
// OREDER BY id DESC is order result by descending
$result=mysql_query($sql);
?>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="6%" align="center" bgcolor="#E6E6E6"><strong>#</strong></td>
<td width="53%" align="center" bgcolor="#E6E6E6"><strong>Titre</strong></td>
<td width="15%" align="center" bgcolor="#E6E6E6"><strong>Views</strong></td>
<td width="13%" align="center" bgcolor="#E6E6E6"><strong>Locataires</strong></td>
<td width="13%" align="center" bgcolor="#E6E6E6"><strong>Date/Time</strong></td>
</tr>
<?php
// Start looping table row
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td bgcolor="#FFFFFF"><? echo $rows['id']; ?></td>
<td bgcolor="#FFFFFF"><a href="?p=view_top?id=<? echo $rows['id']; ?>"><? echo $rows['topic']; ?></a><BR></td>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['view']; ?></td>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['reply']; ?></td>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['datetime']; ?></td>
</tr>
<?php
// Exit looping and close connection
}
mysql_close();
?>
A voir également:
- Sql afficher une table
- Table ascii - Guide
- Table des matières word - Guide
- Afficher appdata - Guide
- Table des caractères - Guide
- Afficher taille dossier windows - Guide
voila