Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <?php
  2. $sqln = mysql_query("SELECT * FROM post ORDER BY id DESC LIMIT ".$inicio.",".$max."");
  3. $num = mysql_num_rows($sqln);
  4. for($i = 0; $i < $num; $i++){
  5. $tituloP = @mysql_result($sqln, $i, "titulo");
  6. $n = $i + 1;
  7. $d = $i % 2;
  8. if($d == 0){$cor = "cinza";}else{$cor = "claro";}
  9. print '<tr class='.$cor.'><td> align="center">'.$tituloP.'</td><tr>';
  10. }
  11.  
  12. ?>
  13.  
  14. <?php
  15. $sqln = mysqli_query($conn, "SELECT * FROM post ORDER BY id DESC LIMIT ".$inicio.",".$max."");
  16. mysqli_close($conn);
  17. while($num_q = mysqli_fetch_array($sqln)){
  18. $tituloP = $num_q['titulo'];
  19. print '<tr class=' /*COR*/'><td align="center">'.$tituloP.'</td><tr>';
  20. }
  21. ?>
  22.  
  23. $index = 0;
  24. while(...) {
  25.  
  26. if($index%2==0){ echo 'class="branco"'; }
  27. else { echo 'class="cinza"'; }
  28.  
  29. $index++;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement