I was just solving issue, where I needed to keep an order of items returned from the MySQL database listen in the WHERE IN clause.
SELECT * FROM table WHERE id IN (1,5,8,73,5,4,88)
This will return rows ordered by its primary key (in my case column id). Here is updated query, which will keep order of items listed in WHERE IN clause:
SELECT * FROM table WHERE id IN (1,5,8,73,5,4,88) ORDER BY FIELD(id,1,5,8,73,5,4,88)
Please note first item in brackets behind ORDER BY – there should be set same column, which was used at WHERE IN clause.
UPDATE: There was missing function called FIELD after ORDER BY – code is fixed now.
When You are working with facebook apps, you do need sometimes to add administrators or moderators to Your application. If selected person is not in Your friend list, You cannot add him to the list using auto-suggest box. Thats the moment, when You will need to know user`s facebook profile id (uid). Real problem is coming when user is using Facebook vanity URL for his/her profile (like www.facebook.com/some.selected.vanity.url). Continue reading How get Facebook profile ID (uid) when using vanity URL
I just got HP Mini 311 ION netbook into my hands. This is one of the first ION based netbooks on the world market. Price is quiet low for the value You will get.
NP Mini 311 has many of interesting technical parameters as you can see in the following producer official technical details table… Continue reading HP Mini 311 – Review & Windows 7 installation