hahaitwork Posted December 13, 2012 Share Posted December 13, 2012 Okey, my script is working mostly as I want. I need a line that picks top 50, and only choose those who submitted with name, if the name plate is blank.. the score should not come up. Here is the line I guess you have to change: $result = mysql_query("SELECT name, score FROM high_scores_avoidthecars ORDER BY score DESC "); Things that should work: 1. Sort out who got the highest score BUT also who submitted it first (checks highest/lowest id) (The lowest id number is also the one that sumbitted first*) 2. Top 50 scores only 3. Only show scores that have a Name submitted as well. The database contain: id, name, score id = auto increase name = the players submitted name score = how much they scored Extra note: I have already a thread that is a bit the same, but will keep both open a little then close the other one. Here is the second thread that will be closed in a few days Quote Link to comment Share on other sites More sharing options...
Christian F. Posted December 13, 2012 Share Posted December 13, 2012 So... WHERE name != ''? Quote Link to comment Share on other sites More sharing options...
hahaitwork Posted December 13, 2012 Author Share Posted December 13, 2012 So... WHERE name != ''? Mind explaining it a little? WHERE name !="? The !="? part I guess it ain't hard to get what it do.. but I don't see the connection about the ! and the " and ? Quote Link to comment Share on other sites More sharing options...
Christian F. Posted December 13, 2012 Share Posted December 13, 2012 It works pretty much the same way in all languages. Most importantly, MySQL and PHP are identical in this area (except for NULL values). The MySQL manual also has all the information you need on this, though may be a bit harder to read. Quote Link to comment Share on other sites More sharing options...
hahaitwork Posted December 13, 2012 Author Share Posted December 13, 2012 It works pretty much the same way in all languages. Most importantly, MySQL and PHP are identical in this area (except for NULL values). The MySQL manual also has all the information you need on this, though may be a bit harder to read. So I tried that "WHERE" thingy.. not 100% where to put it but I thougth and I guessed Behind OR in front of "ORDER by" and got errors hmm.. $result = mysql_query("SELECT name, score FROM high_scores_avoidthecars ORDER BY score DESC WHERE name != '' "); Quote Link to comment Share on other sites More sharing options...
Christian F. Posted December 13, 2012 Share Posted December 13, 2012 The SELECT syntax is defined in the MySQL manual. Quote Link to comment Share on other sites More sharing options...
Barand Posted December 13, 2012 Share Posted December 13, 2012 http://dev.mysql.com/doc/refman/5.6/en/select.html Quote Link to comment Share on other sites More sharing options...
hahaitwork Posted December 14, 2012 Author Share Posted December 14, 2012 Will check those links out Quick update: managed to get the 1,2,3,4,5, etc working.. http://loff-production.com/highscores/avoid-the-cars.html 1. Name. score 2. name. score 3. name score Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.