Jump to content

Loading Only Tables That Contain Text


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
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.


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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.