edition d'une liste a partir de php mysql

Répondre


Cette question est un moyen d’empêcher des soumissions automatisées de formulaires par des robots.
Smileys
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: =D> #-o =P~ :^o :non: :priere: 8-|
Voir plus de smileys
  Revue du sujet
 

  Étendre la vue Revue du sujet : edition d'une liste a partir de php mysql

par thierry59 » 20 avr. 2006, 18:16

Enleve tes <br> ou <br\> dans ton code..

structure d'une table
<table>
<tr>
    <td>Case 1: Ligne1 colone 1</td>
    <td>Case 2:Ligne1 colone 2</td>

</tr>
<tr>
    <td>Case 3: Ligne2 colone 1</td>
    <td>Case 4: Ligne2 colone 2</td>
</tr>
<tr>
    <td>Case 5: Ligne3 colone 1</td>
    <td>Case 6: Ligne3 colone 2</td>
</tr>

</table>
Si à l'intérieur des balsises <td> </td>
tu place des <p> </p> ca te refais passé sur une nouvelle ligne... mais tu reste toujours dans la meme case du tableau


Dans ton example ( ta boucle )
tu alligne tous les "sujet" , tous les "etab_actsc_1"

si tu veux pas les allignés, mes à l'exterieur du While les balises <tr> et </tr>


C plus clair ?

par sokrates » 20 avr. 2006, 17:36

aloooooooooo
où etes vous!!

par sokrates » 20 avr. 2006, 17:05

samehni,
je te comprends pas!!

par charabia » 20 avr. 2006, 17:01

Bé je vois que tu as mis ton <tr> dans la boucle donc ça devrait créer un nouveau <tr> à chaque fois en toute logique.

J'ai un peu de mal à suivre ton code, il est trop brouillon.

Lorsque tu affiches le code source, vois-tu une nouvelle ligne à ce niveau ? QUe vois-tu si ce n'est pas le cas ?

par sokrates » 20 avr. 2006, 16:59

il s'agit d'une boucle qui ecrit chaque enregistrement et le met ds une ligne et doit ecrire la ligne suivante ds la ligne suivante, jusqu"à la fin de la table

par charabia » 20 avr. 2006, 16:55

wow ! utilises les bbcode PHP pour colorer ta syntaxe !

A quel endroit veux-tu faire ces sauts de ligne ?

par sokrates » 20 avr. 2006, 16:53

voila mon code pour editer une liste sous forme de tableau:
<div align="right">
  <table width="100%" border="1" cellspacing=0 cellpadding=0 align="center">
  <tr>
     <th rowspan="2" align="center"><?  echo $e[24] ?></th>
	 <th rowspan="2" align="center"><?  echo $e[23] ?></th>
     <th rowspan="2" align="center"><?  echo $e[22] ?></th>
     <th rowspan="2" align="center"><?  echo $e[21] ?></th>
     <th colspan="2" align="center"><?  echo $e[27] ?></th>
     <th colspan="6" align="center"><?  echo $e[25] ?></th>
     <th colspan="6" align="center"><?  echo $e[5] ?></th>
     <th rowspan="2" align="center"><?  echo $e[4] ?></th>
     <th rowspan="2" align="center"><?  echo $e[3] ?></th>
  </tr>
  <tr>
     <th align="center"><?  echo $e[20] ?></th>
     <th align="center"><? echo( ".") ;   ?></th>
     <th align="center"><?  echo $e[13] ?></th>
     <th align="center"><?  echo $e[19] ?></th>
     <th align="center"><?  echo $e[18] ?></th>
     <th align="center"><?  echo $e[17] ?></th>
     <th align="center"><?  echo $e[12] ?></th>
     <th align="center"><?  echo $e[11] ?></th>
     <th align="center"><?  echo $e[16] ?></th>
     <th align="center"><?  echo $e[9] ?></th>
     <th align="center"><?  echo $e[15] ?></th>
     <th align="center"><?  echo $e[8] ?></th>
     <th align="center"><?  echo $e[7] ?></th>
     <th align="center"><?  echo $e[6] ?></th>
   </tr>
<?
	while ($line = mysql_fetch_array($result))
	{
?>
<br>
   <tr>
      <td width=2.5 % rowspan="6"><? echo( ".") ;   ?></td>
      <td width=2.5 % rowspan="6"> <? echo( ".") ;   ?></td>
      <td width=2 % rowspan="6"><? echo( ".") ;   ?></td>
      <td width=2 % rowspan="6"><? echo( ".") ;   ?></td>
      <td width=2 % rowspan="6"><? echo( ".") ;   ?></td>
      <td width=14 % rowspan="6" align="right"><p> <? echo $t[18]; echo $line["encadreur"]; ?></p> 
	      <p> <? echo $t[19]; echo $line["sujet"]; ?></p>
		  <p> <? echo $t[20]; echo $line["etab_master"]; ?></p></td>
      <td width=10 % rowspan="6" align="right" >
	      <p> <? echo $line["etab_actsc_1"]; ?></p>
	      <p> <? echo $line["etab_actsc_2"]; ?></p>
	      <p> <? echo $line["etab_actsc_3"]; ?></p>
	      <p> <? echo $line["etab_actpf_1"]; ?></p>
	      <p> <? echo $line["etab_actpf_2"]; ?></p>
	      <p> <? echo $line["etab_actpf_3"]; ?></p>
      </td>      
      <td width=2 % rowspan="6"><? echo( ".") ;   ?></td>
      <td width=2 % rowspan="6"><? echo( ".") ;   ?></td>
      <td width=2 % rowspan="6"> <? echo( ".") ;   ?></td>
      <td width=10 % rowspan="6" align="right" >
	      <p> <? echo $line["nat_actsc_1"]; ?></p>
	      <p> <? echo $line["nat_actsc_2"]; ?></p>
	      <p> <? echo $line["nat_actsc_3"]; ?></p>
	      <p> <? echo $line["nat_actpf_1"]; ?></p>
	      <p> <? echo $line["nat_actpf_2"]; ?></p>
	      <p> <? echo $line["nat_actpf_3"]; ?></p>
      </td>      
      <td width=5 % rowspan="6" align="right" >
	      <p> <? echo $line["an_actsc_1"]; ?></p>
	      <p> <? echo $line["an_actsc_2"]; ?></p>
	      <p> <? echo $line["an_actsc_3"]; ?></p>
	      <p> <? echo $line["an_actpf_1"]; ?></p>
	      <p> <? echo $line["an_actpf_2"]; ?></p>
	      <p> <? echo $line["an_actpf_3"]; ?></p>
      </td>      
      <td width=2 % rowspan="6" align="right"><? echo( ".") ;   ?></td>
      <td width=6 % rowspan="6" align="right" >
	      <p> <? echo $line["obs_bac"]; ?></p>
	      <p> <? echo $line["obs_maitr"]; ?></p>
	      <p> <? echo $line["obs_mast"]; ?></p>
	      <p> <? echo $line["obs_doc"]; ?></p>
	      <p> <? echo $line["obs_autr"]; ?></p>
      </td>      
      <td width=2 % rowspan="6" align="right"><? echo( ".") ;   ?></td>
     <td width=3 % rowspan="6" align="right" >
	      <p> <? echo $line["date_bac"]; ?></p>
	      <p> <? echo $line["date_maitr"]; ?></p>
	      <p> <? echo $line["date_mast"]; ?></p>
	      <p> <? echo $line["date_doc"]; ?></p>
	      <p> <? echo $line["date_autr"]; ?></p>
     </td>      
     <td width=5 % rowspan="6" align="right" >
	      <p> <? echo $line["spec_bac"]; ?></p>
	      <p> <? echo $line["spec_maitr"]; ?></p>
	      <p> <? echo $line["spec_mast"]; ?></p>
	      <p> <? echo $line["spec_doc"]; ?></p>
	      <p> <? echo $line["spec_autr"]; ?></p>
     </td>      
     <td width=2.5 % rowspan="6" align="right" >
		  <p> <? echo $t[25];  ?></p>
		  <p> <? echo $t[26];  ?></p>
		  <p> <? echo $t[27];  ?></p>
		  <p> <? echo $t[28];  ?></p>
		  <p> <? echo $t[29];  ?></p>
     </td>      
      <td width=8.5 % rowspan="6" align="right"><? echo $line["nom"] ; ?>     <? echo $line["prenom"] ;  ?></td>
      <td width=5 % rowspan="6" align="right"><? echo $line["num_cin"] ; ?></td>
	</tr>
</br>
<?
	}
		  
?>		  
</center></table>

  </div>

par charabia » 20 avr. 2006, 16:50

Si tu affiches juste les données tu fais simplement :
echo $ta_var."<br />";
Mais avec ton code on verrait beaucoup mieux ;)

par Shekhmet » 20 avr. 2006, 16:46

Montre la partie de code ou tu récupères tes variables qui te resorte ligne1, ligne2 ...

Ca sera plus simple pour te montrer ;)

par sokrates » 20 avr. 2006, 16:42

c à d je fait :
<br> <tr> ........</tr></br>
??
excusez moi je suis un débutant en developpement de site

par charabia » 20 avr. 2006, 16:31

Un p'tit morceau de code serait pas mal ;)

Mais pour ton souci, ne faut-il pas tout simplement mettre un <br /> ?

par Shekhmet » 20 avr. 2006, 16:31

Après chaque récupération de variable tu mets un <br>

edition d'une liste a partir de php mysql

par sokrates2 » 20 avr. 2006, 16:29

je viens d'ecrire un programme en php pour lister des données a partir d'une base mysql sous forme d'un tableau, mais je reçois les lignes en horizontal comme ça :
ligne1 ligne2 ligne 3 ....
et non pas comme ça :
ligne1
ligne2
ligne3
.
.
.
comment faire svp!!! et merci d'avance