skooda Posted December 29, 2012 Posted December 29, 2012 <?php include 'header.php'; echo "<br /><br />"; $achievements = mysql_query("SELECT * FROM `achievements` ORDER BY `id` ASC"); $count = mysql_num_rows($achievements); echo "<table width='100%' align='center'><tr> <th width='25%' class='contenthead'>Image</th> <th width='50%' class='contenthead'>Text</th> <th width='25%' class='contenthead'>Completed</th> </tr>"; while($r = mysql_fetch_assoc($achievements)) { $query = ''; $query = mysql_query("SELECT * FROM `achievement` WHERE `a_id` = {$r['id']} AND `u_id` = ".mysql_real_escape_string($_SESSION['id'])); if(mysql_num_rows($query) == 1) { $complete = '<font color="green">Finished</font>'; }else { $complete = '<font color="red">No</font>'; } $r['text'] = str_replace('[value]', number_format($r['value']), $r['text']); echo "<tr> <td class='contentcontent' align='center'><img src='".$r['image']."' /></td> <td class='contentcontent' align='center'>".$r['text']."</td> <td class='contentcontent' align='center'>".$complete."</td> </tr>"; } echo "</table><br /><br />"; include 'footer.php'; ?> A little help/knowledge requested. Anyone know how to make this achievement page display 6 awards at a time. Then a user click next or back to see the next awards. Quote
jaymo Posted December 29, 2012 Posted December 29, 2012 Like a pagination? You can do an SQL statement to select a 6 records between a certain amount say you show IDs 1 to 6 them click next and it will show 7 to 12 and so on :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.