Jump to content

Loading Only Tables That Contain Text


hahaitwork

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/271954-loading-only-tables-that-contain-text/
Share on other sites

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.

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 != '' ");

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.