i used a mysql query where there is \"where id in (\"22,20,21\") \" but when i get the result its like array ordered in asecending order ie 20,21,20
but i need it i
As mentioned... WHERE clause doesn't do anything with ordering of result set. Use MySQL built-in FIELD function in ORDER BY clause to specify how the result set should be ordered:
WHERE
ORDER BY
... WHERE id IN (22, 20, 21) ORDER BY FIELD(id, 22, 20, 21) ...