daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $query = mysql_query("SELECT * FROM `Caractere`");
  3. $google_ad = "RECLAMA!!!!!!!!!!!!";
  4. $i = 0;
  5. ?>
  6. <table width="450" border="2">
  7.     <tr>
  8.         <td>Nr. crt.</td>
  9.         <td>Nume</td>
  10.         <td>Prenume</td>
  11.         <td>Locatie</td>
  12.     </tr>
  13. <?php while ($row = mysql_fetch_array($query)) : ?>
  14. <?php $i++; ?>
  15. <?php if ($i == 3 || $i == 10) : ?>
  16.     <tr>
  17.         <td colspan="4" align="center"><?php echo $google_ad; ?></td>
  18.     </tr>
  19. <?php elseif ($i-1 == 3 || $i-1 == 10) : ?>
  20.     <tr>
  21.         <td><?php echo $i-1; ?></td>
  22.         <td><?php echo $row['nume']; ?></td>
  23.         <td><?php echo $row['prenume']; ?></td>
  24.         <td><?php echo $row['locatie']; ?></td>
  25.     </tr>
  26. <?php else : ?>
  27.     <tr>
  28.         <td><?php echo $i; ?></td>
  29.         <td><?php echo $row['nume']; ?></td>
  30.         <td><?php echo $row['prenume']; ?></td>
  31.         <td><?php echo $row['locatie']; ?></td>
  32.     </tr>
  33. <?php endif; ?>
  34. <?php endwhile; ?>
  35. </table>
RAW Paste Data
Top