IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Affichage par page


Sujet :

Langage PHP

  1. #1
    Nouveau Candidat au Club
    Homme Profil pro
    Enseignant
    Inscrit en
    Mai 2012
    Messages
    1
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Mai 2012
    Messages : 1
    Points : 1
    Points
    1
    Par défaut Affichage par page
    bonjour;
    je suis nouveau dans la programmation php. le code suivant affiche tous les resultats en un seul bloc. je veux avoir l'affichage par page de 30 chacune. Merci bcp
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    <?php
    include_once("configr.php");
     
    mysql_connect($host,$user,$pwd);
    mysql_select_db($nbd);
     
    $cot=$_POST['cote'];
    $aut=$_POST['aut'];
    $art=$_POST['art'];
    $rub=$_POST['rub'];
    $an=$_POST['an'];
    $num=$_POST['num'];
     
    $req=mysql_query("select * from revue where cote like '%$cot%' and aut like '%$aut%' and art like '%$art%' and rub like '%$rub%'and an like '%$an%'and num like '%$num%'");
     
    ?>
    <style type="text/css">
     
    </style>
    <div align="center">
    <?php  if ( mysql_num_rows($req)!=0)
    {
    echo utf8_encode('Nombre de revues trouv&eacute;es: ');
    echo (mysql_num_rows($req));?>
    </div>
     
    <table width="85%" height="54" border="0" align="center" cellspacing="2">
      <tr bgcolor="#CCCCCC">
        <td width="70" height="30" nowrap="nowrap"><div align="center" class="Style2">Cote</div></td>
    	<td width="537"><div align="center" class="Style2">Article</div></td>
        <td width="100" nowrap="nowrap"><div align="center" class="Style2">Auteur</div></td>
    	<td width="60" nowrap="nowrap"><div align="center" class="Style2">Ann&eacute;e</div></td>
        <td width="60" nowrap="nowrap"><div align="center" class="Style2">Num&eacute;ro</div>    </td>
    	<td width="150" nowrap="nowrap"><div align="center" class="Style2">Rubrique</div>    </td>
    	<td width="10" nowrap="nowrap"><div align="center" class="Style2">Page</div>    </td>
     
      </tr>
      <?php while ($don=mysql_fetch_row($req))
      {?>
     
      <tr  valign="top" nowrap="nowrap" bgcolor="#FFFFCC"  class="xx">
       <td height="22" nowrap="nowrap"><div align="left" class="Style1 Style3"><?php echo $don[0] ;?></div></td>
        <td ><div align="left" class="Style4" lang="fr"><?php echo utf8_encode($don[2]) ;?></div></td>
        <td nowrap="nowrap"><div align="left" class="Style4"><?php echo utf8_encode($don[1]);?></div></td>
        <td nowrap="nowrap"><div align="center" class="Style4"><?php echo utf8_encode($don[3]) ;?></div></td>
        <td nowrap="nowrap"><div align="center" class="Style4"><?php echo $don[4] ;?></div></td>
    	<td nowrap="nowrap"><div align="left" class="Style4"><?php echo utf8_encode($don[5]) ;?></div></td>
    	<td nowrap="nowrap"><div align="center" class="Style4"><?php echo $don[6] ;?></div></td>
     
      </tr>
     
      <?php } ?>
    </table>
    <?php }  else echo utf8_encode("<br><div class='Style2'> Aucune revue trouv&eacute;e</div> " );?>

  2. #2
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

Discussions similaires

  1. Moteur de recherche, affichage par page et url rewriting
    Par paupiette dans le forum Langage
    Réponses: 5
    Dernier message: 22/06/2007, 10h45
  2. [FPDF] Affichage par page
    Par kagura dans le forum Bibliothèques et frameworks
    Réponses: 7
    Dernier message: 16/05/2006, 12h33
  3. [MySQL] Problème d'affichage par page
    Par nal dans le forum PHP & Base de données
    Réponses: 23
    Dernier message: 29/04/2006, 14h00
  4. [MySQL] Affichage par page page : pages blanches à la fin
    Par carelha dans le forum PHP & Base de données
    Réponses: 2
    Dernier message: 11/04/2006, 13h27

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo