Need Help! Please!

admin

Administrator
Staff member
Dear all,

I have 2 tables in the Database:
1. Country
- ID
- Name

ID Name
1 USA
2 China
3 France
4 Italy
....

2. Customer
- ID
- Name
- CountryID

1 Peter 1
2 John 2
3 Mary 1
4 David 3
...

Originally, I use
$result = mysql_query("select distinct Customer.ID, Customer.Name, Customer.CountryID".
"from Database where $cond order by Customer.ID, Customer.CountryID desc limit $offset,$limit" );

Now I want to use "IF" inside MySQL_Query for ranking the database better
e.g. I can let If Customer.CountryID is 4 the result of Customer.CountryID=4 can be higher position.

By Refering:

<!-- m --><a class="postlink" href="http://www.phpbuilder.com/forum/read.php3?num=5&id=1725&thread=1712">http://www.phpbuilder.com/forum/read.ph ... hread=1712</a><!-- m -->

But I failed to make it works...
Any body help?!?!?!
 
Back
Top