Jump to content

simple mysql values limiting... help


TFG

Recommended Posts

i have this table called details on my database

and the details table has a column  called category

in the category column there are rows having value  1 to 100

 

so if i do this

$query = "SELECT * FROM details ORDER BY category DESC LIMIT 5".
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo $row['category'];
echo "<br />";
}

it outputs like this

100

100

100

99

99

98

98

 

so what i am trying to do is limiting 5 values only at once like

100

99

98

97

96

95

 

pls tell me how i can do this.

Link to comment
https://forums.phpfreaks.com/topic/101473-simple-mysql-values-limiting-help/
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.