Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ORDER BY?

Status
Not open for further replies.

7724

Programmer
Feb 25, 2005
28
GB
Hi Guys,

Writing a php script, which looks into a MySQL database.

Now I want the script to look into what data has been saved into my game table and output the data by positions in order iw goalkeeper 1st, defender 2nd, midfield 3rd. I thought it would be like this but it does not work - any idea thanks?

Code:
$Query = "SELECT * from $TableName ORDER by (game.profile = 'Goalkeeper', game.profile = 'defender', game.profile = 'Midfield',)";
 
1. It seems it's not PHP question, see SQL:
WHERE ... = ...
but
ORDER BY field_name_list
2. SELECT * from php_var then game.field_name = ... - eh?..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top