Jump to content
Sign in to follow this  
Weiss

fetch the data

Recommended Posts

hi. i have an array with 8 id numbers (e.g. [4234, 3241, 2313, ....];

i have an sql table with those id numbers among others.. i want to make a query with fetch the data, i can do that with using IN (4234,3241....)

but the problem is that i get the data when its oredered by numbers from small to big.. i want it oredered exactly as the array meanning the first row should be with id = 4324, second with 3241 etc...

how can i do that? thanx

Share this post


Link to post
Share on other sites

create a variable for everything inside the parens.   

 

Do you need procedural or OO code?

Edited by niche

Share this post


Link to post
Share on other sites

Use a separate field in the table to specify the sort order, and when you insert the data make the sort order field whatever order you want to retrieve the data.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...