Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1. <?php
  2.  
  3. $connection = mysqli_connect("localhost", "root", "23423", "prueba");
  4.  
  5.  
  6. $query = mysqli_query($connection, "SELECT * FROM `tabla`");
  7.  
  8.  
  9. $rows = array();
  10.  
  11. while($row = mysqli_fetch_assoc($query))
  12. {
  13.     $rows[] = $row;
  14. }
  15.  
  16. ?>
  17.  
  18. <table>
  19.  
  20.     <thead>
  21.         <?php
  22.         for($i=0;$i<6;$i++) {
  23.             echo "<th>".$rows[$i]["nombre"]."</th>";
  24.         }
  25.         ?>
  26.     </thead>
  27.  
  28.     <tr>
  29.         <?php
  30.         for($i=0;$i<6;$i++) {
  31.             //echo "<td>".$rows[$i]["nombre"]."</td>";
  32.             echo "<td>Datos</td>";
  33.         }
  34.         ?>
  35.     </tr>
  36.  
  37.     <tr>
  38.         <?php
  39.         for($i=0;$i<6;$i++) {
  40.             echo "<td>".$rows[$i]["ranking"]."</td>";
  41.         }
  42.         ?>
  43.     </tr>
  44.  
  45.  
  46.  
  47. </table>
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. <?php
  56.  
  57. $connection = mysqli_connect("localhost", "root", "3423423", "prueba");
  58.  
  59.  
  60. $query = mysqli_query($connection, "SELECT * FROM `tabla`");
  61.  
  62.  
  63. $rows = array();
  64.  
  65. while($row = mysqli_fetch_assoc($query))
  66. {
  67.     ?>
  68.  
  69.     <div style="float:left">
  70.  
  71.         <div style="font-weight:bold"><?php echo $row["nombre"] ?></div>
  72.         <div>Datos..</div>
  73.         <div><?php echo $row["ranking"] ?></div>
  74.  
  75.     </div>
  76.  
  77.     <?php
  78. }
  79.  
  80. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement