I am currently working on making a menu editor for my site. All the diffrent items in the menu are stored on a table in a DB.
Each item is enumerated onto that page. To start with I have decided to make a system which can re-order the items.
I am working with 2 fields, ID and ORD;
ID is just so I can easily refer to the items if i want to delete um etc.
ORD is what order they are populated in on the actual site (and on the menu editor).
I have the first part sorted out; each drop down menu on the site you can choose the order number, and each menu has been enumerated (i'll show you an example below).
ID_1 ORD_1
ID_2 ORD_2
ID_3 ORD_3
...and so on.
What I want to do is when the diffrent http vars have been sent to the script, the diffrent vars need to be put into 1 array:
$ORD[1] = $ORD_1;
$ORD[2] = $ORD_2;
$ORD[3] = $ORD_3;
NOW, i could do it that way, but obviously it's not gonna be practical as I wouldnt be able to add new items without having to go back to the code and add another line.
I need to to add each item to the $ORD array depending on how many IDs are returned from the DB query, so nomatter how many $ORD_ vars are sent by the form on the main page, it will add each one to the $ORD[] array.
It's a tricky one to explain, but I hope I made it as clear as possible 🙂
Thanks all, merry christmas 😃