Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. <?php
  2. include('log.php');
  3.  
  4. $query = "SELECT * FROM files";
  5. $result = mysql_query($query) or die('Query failed: ' . mysql_error());
  6.  
  7. $count = 0;
  8.  
  9. while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
  10.     $td .= '<td>' . $row['file'] . $row['ext'] . '</td>;
  11.     $count++;
  12.  
  13.     if($count == 1){
  14.         $string .= '<tr>'.$td;
  15.     }
  16.     elseif($count == 4){
  17.         $string .= $td.'</tr>';
  18.         $count = 0;
  19.     }
  20.     else{
  21.         $string .= $td;
  22.     }
  23. }
  24.  
  25. echo '
  26. <table>
  27. '.$string.'
  28. </table>';
  29.  
  30.  
  31. mysql_close($lnk);
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement