#1  
Old 5th July 2006, 14:10
badben badben is offline
Senior Member
 
Join Date: Oct 2005
Location: Lancashire, UK
Posts: 103
Thanks: 0
Thanked 2 Times in 2 Posts
Question Sorting Results in MySQL

I have a problem trying to sort results in mysql with tables as follows:

Table: Jobs

job_id category_id employer ......
1 1 fred
2 1 joe
3 2 ken
. . .
. . .
. . .

Table: Categories

cat_id cat_description
1 engineering
2 accountancy
. .
. .

How do I sort through the results of a query on the job table by cat_description alphabetically (which is in another table linked by cat_id)
__________________
Web Developer
Reply With Quote
Sponsored Links
  #2  
Old 5th July 2006, 14:28
sjau sjau is offline
Local Meanie
 
Join Date: Apr 2006
Location: Switzerland
Posts: 1,146
Thanks: 4
Thanked 55 Times in 51 Posts
 
Default

Query is something like this:

PHP Code:
$sql "SELECT * FROM Jobs, Categories WHERE Jobs.category_id=Categories.cat_id ORDER BY cat_description ASC";
$result mysql_query($sql); 
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL installation roblem [/me sad] Nejko Installation/Configuration 16 11th January 2006 13:28
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 16:04
Problem installing ISPConfig, then with MySQL... ctroyp Installation/Configuration 7 26th September 2005 16:37
MySQL issue during install of ISPConfig ricbax Installation/Configuration 4 16th September 2005 09:41
Mysql ejs Installation/Configuration 5 12th August 2005 07:01


All times are GMT +2. The time now is 14:50.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.