L'affichage des données saisie par un administrateur

Fermé
salyyas - 22 juin 2014 à 22:36
DelNC Messages postés 2234 Date d'inscription samedi 25 octobre 2014 Statut Membre Dernière intervention 22 février 2020 - 4 nov. 2015 à 02:32
bonjour
je veux savoir comment je vais afficher les donnees saisie par un administrateur (partie admin)dans la page du site web (partie visiteur)
A voir également:

1 réponse

Bonjour,


sur la page où vous voulez avoir l'affichage vous faites la requête sql pour avoir le contenu de la table.

<?php
$query = "SELECT colonne1, colonne2, colonne3 ";
$query .= "FROM table";
$query .= ";
$result = execute_query($query);
display_table_resultat($result);

function display_table_resultat ($result) {
echo "<table border=1>\n";
//HEADER ROW
echo "<tr>\n";
echo " <th width=200> colonne1 </th>\n";
echo " <th width=200> colonne2 </th>\n";
echo " <th width=200> colonne3 </th>\n";
echo "</tr>\n";
//DATA ROWS
while($row = mysql_fetch_array($result)) {
echo "<tr>\n";
echo " <td class=\"center\">" . $row[0] . "</td>\n";
echo " <td class=\"center\">" . $row[1] . "</td>\n";
echo " <td class=\"center\">" . $row[2] . "</td>\n";
echo "</tr>\n";
}//end while
echo "</table>\n";
}//end function
?>
4
DelNC Messages postés 2234 Date d'inscription samedi 25 octobre 2014 Statut Membre Dernière intervention 22 février 2020 1 999
4 nov. 2015 à 02:32
Hello

Dommage qu'il n'y ai pas d'explications.

Sinon c'est bien
0