[RESOLVED] [VB6 MYSQL] My SQL things 60 is bigger than 5320!
Hello, I need help as fast as possible. I am posting this here since I have gotten much of my MYSQL help here. I have my game I programmed in VB6 to sent the high score to my webserver and add it to a table. That works. My php page pulls the information correctly, almost. I have it sorting the entires by the Score so I can show placing, 1st, 2nd, ect.
$sql = "SELECT Name,Score,Level,DateTime FROM $table_name ORDER BY Score DESC";
My problem is that it puts the score of 600 before the score of 5420, since 6 is bigger than 5. Can someone please help me get this to sort by largest to smallest, so the scores go something like...5000, 4000, 3000 no like 60, 5000, 4000.
Thank you.
Re: [VB6 MYSQL] My SQL things 60 is bigger than 5320!
Is score stored as text? If so you prolly want to cast it to an integer or sort it yourself.
Re: [VB6 MYSQL] My SQL things 60 is bigger than 5320!
Based on what you've said, it would appear that you're storing the scores as type string - instead of numeric. Changing the type to numeric should solve your problem. If that's not an options, then pad the scores with leading zeroes so that all scores are, say, 10 digits (e.g., "0000005420").
Re: [VB6 MYSQL] My SQL things 60 is bigger than 5320!
For some reason the table was copied wrong. My other tables I used had them stores as Integers. This table had it as Text. I have no idea how it changed but that was the problem. thanks all.