Jump to content

paging in forloop


anand.arjunan

Recommended Posts

Hi i need the below code paging and per par page 3 rows and each row 3 colums total 9 records per page how to write the code please give sample codes$qry=("select * from register where gender='".$ser."' and countryid='".$coun."'"); $exc=mysql_query($qry); $gettotalusers=@mysql_num_rows($exc); for($i=0;$i<$gettotalusers;$i++) { $getuserdata=mysql_fetch_array($exc); $userid=$getuserdata['user_id']; $username=$getuserdata['uname']; $userimage=$getuserdata['user_image']; $FilePath="user_images/".$userimage; $date=$getuserdata['dob']; $dob = explode("-",$date); $year= $dob[0]; $age=(date('Y')-$year); ?><table width="185" height="160" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="192" align="left" valign="top" class="photo_border" scope="col"><table width="185" height="160" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="20" align="left" valign="middle" class="search_hesding" scope="col"><?=$username?></td> </tr> <tr> <td align="left" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="120" height="140" align="center" valign="middle" scope="col"><table width="110" height="120" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle" bgcolor="#FFFFFF" class="photobox" scope="col"><img src="<?= $FilePath; ?>" width="66" height="91"></td> </tr> </table></td> <td align="center" valign="middle" class="search_text" scope="col"><p>Active within 24 hours </p></td> </tr> </table></td> </tr> <tr> <td height="22" align="left" valign="middle" class="search_hesding"><table width="50%" border="0" cellspacing="0" cellpadding="0"> <tr align="left" valign="middle"> <th width="10" scope="col"> </th> <th scope="col"><img src="images/contact.gif" alt="contact" width="16" height="16"></th> <th scope="col"><img src="images/virtual.gif" alt="Send virtual kiss" width="16" height="16"></th> <th scope="col"><img src="images/favour.gif" alt="Add favorites" width="16" height="16"></th> </tr> </table></td> </tr> </table></td> </tr> <? }?> </table>

Link to comment
Share on other sites

There are a lot of examples for that on the forum if you search. You will want to use the LIMIT keyword in SQL to limit the results that are returned, and pass some variables through the querystring to tell you which page you are currently on.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...