[eluser]foska[/eluser]
Code: Error Number: 1305
FUNCTION ******.FIELD does not exist
SELECT `id`, `image`, `sex` FROM `users` WHERE `id` IN (28,35,40,34,33) ORDER BY FIELD (id,28,35,40,34,33)
here using $this->db->query();
Need help in this...
[eluser]foska[/eluser]
hm... probably it`s hosting problem
[eluser]prakash[/eluser]
do you want the results in order by id? if so use
Code: SELECT `id`, `image`, `sex` FROM `users` WHERE `id` IN (28,35,40,34,33) ORDER BY id
[eluser]foska[/eluser]
[quote author="prakash" date="1340102509"]do you want the results in order by id? if so use
Code: SELECT `id`, `image`, `sex` FROM `users` WHERE `id` IN (28,35,40,34,33) ORDER BY id
[/quote] Yes, but I want to save original ordering, as in "where in" section
[eluser]prakash[/eluser]
if your number of records are less you can go with
Code: SELECT `id`, `image`, `sex` FROM `users` WHERE `id` IN (28,35,40,34,33) ORDER BY id='28',id='35',id='40',id='34',id='33'
[eluser]foska[/eluser]
it was problem in space between FIELD and ()... Now working
|