cwncool Posted February 10, 2007 Share Posted February 10, 2007 I have a script, that displays the correct information fine, all four fields from the table. It is this <?php include 'connect.php' ?> <table> <tr> <th>user</th> <th>num</th> </tr> <?php $con = mysql_query("SELECT * FROM users ORDER BY num DESC"); while($arr = mysql_fetch_array($con)) { ?> <tr> <td><? echo $arr['user']; ?></td> <td><? echo $arr['num']; ?></td> </tr> <?php } ?> </table> It does as it should, and displays the 4 records from the database. The thing is, I only want it to display 3 records that would normally display. What can I do to have it only display 3 records? EDIT: figured it out right away. MySQL "LIMIT" command. Nevermind. Link to comment https://forums.phpfreaks.com/topic/37932-solved-phpmysql-only-displaying-a-set-amount-of-records/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.