views:

89

answers:

2

How come in my code when i use @"select Score from tblMed order by Score desc limit 10" everything works fine, but when I change "desc" to "asc" the scores don't show up???

A: 

Do you have NULL scores in your records?

If you change the ordering to asc, then it would start with NULLs before selecting records with an actual value.

Brandon
Right now the whole table is filled with zeros because i haven't play the game yet. How do i Make it so they aren't null?
Steve
+1  A: 

Because:

ORDER BY score ASC

...means that the lowest values will be at the top of the list - adding LIMIT 10 to the query will return the first 10 records with the lowest scores, so I imagine you have entries with score values of zero and/or null.

OMG Ponies
Yes, they are all zeros, how do i make them not zeros, or not null?
Steve
@Steve: What would you like the lowest scores to be displayed as?
OMG Ponies