Jump to content

Taking first 10 results from database?


zrweber

Recommended Posts

I'm having some difficulty. I've tried a few things with no luck.  :'( Is there a way where I can take only the first 10 results of $row['username']?

 

$query = mysql_query("SELECT * FROM users ORDER BY dirStamp DESC") or die("Sorry there was an error.");
$numrows = mysql_num_rows($query);
while ($row = mysql_fetch_assoc($query)) {
echo $row['username'];
echo "</br>";
}

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/224448-taking-first-10-results-from-database/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.