PHP Bucle Table


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?
  2. $r=query("select * from museo where prov_id like 1 order by nombre ");
  3. $n=count($r)-1;
  4. $class="";
  5.  
  6. for($i=0; $i<$n; $i++)
  7. {
  8. if($class=='class="odd"') $class=''; else $class='class="odd"';
  9. ?>
  10.  
  11. <tr <? echo $class ?> ><td><? echo ver($r, $i, "nombre"); ?></td>
  12. <td class="action">
  13. <a id="ver2<? echo $i ?>" href="museo-coleccion.php?id=<? echo(ver($r, $i, "museo_id")); ?>"class="view">Coleccion</a>
  14. <a id="ver<? echo $i ?>" href="museo-fotos.php?id=<? echo(ver($r, $i, "museo_id")); ?>"class="view">Fotos</a>
  15. <a id="editar<? echo $i ?>" href="museo-e.php?id=<? echo(ver($r, $i, "museo_id")); ?>" class="edit">Editar</a>
  16. <a href="museo-b.php?id=<? echo(ver($r, $i, "museo_id")); ?>&cat=<? echo rget("cat"); ?>&zona=<? echo rget("zona"); ?>" id="borrar<? echo $i ?>" class="delete">Borrar</a><div class="<? if(ver($r, $i, "estado") == 1){?>visible<?} else { ?> invisible <?}; ?>"></div></td>
  17. </tr>
  18. <?}
  19. };
  20. }?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.