![]() |
How to get row number from 2 top numberd rows
Hi, i need little help with this.
I have mysql like this: PHP Code:
Now i need to get number of rows for 2 top used countys, in this case that is 1=Europe and 2=Canada, so need to get $europe = 3 rows AND $canada = 2 rows. I cant just count rows becouse i dont know which country is in most rows. |
Please try the following query. I hope this is something like what you're after!
sql Code:
|
Thank you, it is what iam looking.
With this code i can get first 2 names of most used countrys: PHP Code:
|
I think i got something, but meybe thers better way.
PHP Code:
|
Hmm. I think the query I posted to you originally will do it for you. Try something like the following in your PHP code, after the query:
php Code:
Is this what you're after? It will display how many rows there are of that particular country, ordered with the most popular at the top. |
Yes, thats it, i think i was try this after you first answer, hmm, butt now all work good. Thanks
|
| All times are GMT. The time now is 08:52 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0