Hi all,
users on my web site are divided into 2 categories - certified and uncertified users. My site also contains section "TOP list" where the best users (my site is related to the online RPG game) are listed. The thing is that I want to list the certified users before the uncertified ones(the further sorting is already done). In the MySQL dataabase I have the field named "certifydate" in the user table which contains unix timestamp of the date when the user was certified. So this field can be used to recognize certified users (uncertified have 0 in this field).
My query looks like this right now:
I need to add something like this after the ORDER BY statement:
`certifydate`<>0 DESC
I don't have any experience about making queries containing statements which should be calculated before application but this seems to me like it could work.
Any suggestions?
users on my web site are divided into 2 categories - certified and uncertified users. My site also contains section "TOP list" where the best users (my site is related to the online RPG game) are listed. The thing is that I want to list the certified users before the uncertified ones(the further sorting is already done). In the MySQL dataabase I have the field named "certifydate" in the user table which contains unix timestamp of the date when the user was certified. So this field can be used to recognize certified users (uncertified have 0 in this field).
My query looks like this right now:
Code:
SELECT * FROM `users` WHERE 1 ORDER BY `rank` DESC, `experience` DESC, `login`
I need to add something like this after the ORDER BY statement:
`certifydate`<>0 DESC
I don't have any experience about making queries containing statements which should be calculated before application but this seems to me like it could work.
Any suggestions?