Jump to content

[SOLVED] MySQL query to sort DESC is only bringing back positive integers.


blurredvision

Recommended Posts

EDIT:  Nevermind, figured out what I was doing wrong.

 

I have a leaders table on my site that pulls data from a field in my database.  I limit it to pulling the top 5 in a descending order.  The field is set up to be a TINYINT (not unsigned) with 3 characters.  Integers are stored as, for example, 5 for a positive number, -5 when it's a negative number.  Pretty simple stuff.

 

So I have my query:

 

$leadersquery1 = "SELECT gamertag_id,turnover_ratio FROM league_leaders WHERE season=$currentseason ORDER BY turnover_ratio DESC LIMIT 5";

 

At the moment, it should be pulling the following: 4, 3, 1, 0, 0.  However, it's only pulling the 4, 3, and 1, and it's not showing the 0's.

 

Am I glancing over something, or do I need to provide more info?  I've also tried setting a column type of FLOAT, but it simply does the same thing.

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.