# Order defined by user

**URL:** <https://forum.kirupa.com/t/order-defined-by-user/253946>\
**Category:** programming\
**Created:** [March 6, 2008, 6:00pm UTC](https://forum.kirupa.com/t/order-defined-by-user/253946 "2008-03-06T18:00:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![esferaweb](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/esferaweb/32/2104_2.png) [@esferaweb](https://forum.kirupa.com/u/esferaweb)\
**Post date:** [March 6, 2008, 6:00pm UTC](https://forum.kirupa.com/t/order-defined-by-user/253946/1 "2008-03-06T18:00:52Z")

</div>

Hello,

how can i build a mysql select that read an array and order the results according to the sequence found in the array.

\*\*Ex.  
\*\*  
I have two tables, **gallery** and **images**.  
On gallery i have a column called **order**. the content is a array (Ex. 4, 2, 3, 1)  
this numbers are the id´s of the images.

I have an image gallery adm. system. The user can change the order of images.  
I can save this order on line **order**. ok.

But I can not do that, the system read this order and open the images in this order.

* * *

If anyone can help, thanks
