blurredvision Posted September 4, 2008 Share Posted September 4, 2008 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. Link to comment https://forums.phpfreaks.com/topic/122797-solved-mysql-query-to-sort-desc-is-only-bringing-back-positive-integers/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.