L'affichage des données saisie par un administrateur

salyyas -  
DelNC Messages postés 2360 Statut Membre -
bonjour
je veux savoir comment je vais afficher les donnees saisie par un administrateur (partie admin)dans la page du site web (partie visiteur)

1 réponse

  1. Delphine
     
    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
    1. DelNC Messages postés 2360 Statut Membre 2 010
       
      Hello

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

      Sinon c'est bien
      0