Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › Creating Page Sets or Number of records per page
New Posts  All Forums:Forum Nav:

Creating Page Sets or Number of records per page

post #1 of 2
Thread Starter 
Well my website has had hundreds of files uploaded to it but they are all just shown on one page.

How can I go about showing 10 per page only and adding a page count at the bottom.
Heres my current code:

Code:

      <table width="585px" border="1" bordercolor="#000000">
        <tr>
          <td width="200px" height="34"><div align="center"><strong>ScreenShot</strong></div></td>
          <td width="150px"><div align="center"><strong>Name</strong></div></td>
          <td width="65px"><div align="center"><strong>Uploaded</strong></div></td>
          <td width="65px"><div align="center"><strong>Size</strong></div></td>
          <td width="40px"><div align="center"><strong>Rating</strong></div></td>
          <td width="65px"><div align="center"><strong>Downloads</strong></div></td>
        </tr>
<?
$sql = "SELECT * FROM map WHERE is_approved=0 ORDER BY date_created DESC";
$results = mysql_query($sql);
while ($row = mysql_fetch_assoc($results)) {
    $rating = jst_get_value("SELECT AVG(rating) FROM `map_rating` WHERE map_id='" . $row['map_id'] . "'");
    $rating = empty($rating) ? '0' :  number_format($rating, 2);
?>
<tr>
<td><a href="<?= $_SERVER['PHP_SELF'] . '?map_id=' . $row['map_id'] ?>"><img src="<?= HTTP_FULL . $row['image_small'] ?>" alt="Map" width="200" height="125" border="0px"  /></a></td>
<td><p align="center"><strong>Title</strong>: <?= htmlentities($row['map_name']) ?><br />
<strong>Author</strong>: <?= htmlentities($row['map_author']) ?></td>
<td><div align="center"><?= date('d/m/Y', strtotime($row['date_created'])) ?></div></td>
<td><div align="center"><?= number_format($row['file_size'], 2) ?>Kb</div></td>
<td><div align="center"><?= $rating ?></div></td>
<td><div align="center"><?= jst_count("map_download", "map_id='" . $row['map_id'] . "'") ?></div></td>
</tr>
<?

}

?>

</table> 
<h1 align="center" class="h1">Previous | Next</h1>
Heres the webpage in question:
http://fc2maps.com/maps.php

See what I mean
    
CPUMotherboardGraphicsRAM
Intel i7-4850HQ  Yes GT 750M 16GB Corsair 
Hard DriveHard DriveOSMonitor
512GB SSD 1TB Buffalo Drivestation OSX Mavericks 15" 2880 x 1800 IPS 
MouseOther
Magic Mouse Mobee Magic Charger 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Intel i7-4850HQ  Yes GT 750M 16GB Corsair 
Hard DriveHard DriveOSMonitor
512GB SSD 1TB Buffalo Drivestation OSX Mavericks 15" 2880 x 1800 IPS 
MouseOther
Magic Mouse Mobee Magic Charger 
  hide details  
Reply
post #2 of 2
this might work

Also in Firefox 3, the table is running outside of your layout, the downloads column is about halfway into your background, if you didn't already know
Edited by Faster_is_better - 12/19/08 at 11:00am
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Web Coding
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › Creating Page Sets or Number of records per page