Moving rows in MySQL w/ PHP4

admin

Administrator
Staff member
Hello,

I am currently writing a web frontend to some firewall software using PHP4 + MySQL.

I have 2 tables, one for objects, and one for rules. The tables display wonderfully via the web, but I need to be able to move a certain row above/below another row and have it write back to the database and reorder the table via the web.

For example:

ID is primary key, auto_increment unsigned int

ID |Action | Src | Dst | Port
1 xxx xxx xxx xxx
2 xxx xxx xxx xxx
5 xxx xxx xxx xxx

So...the user would have to be able to move 5 before 1, or 1 after 2 ...and have it update the db.

I know this may not make perfect sense...but the jist is that the fireall rules must be applied in a particular order for them to work...and I would create a popup that says something like "Move $id before/after ___ ".

Any and all help appreciated...I can try to be more concise if this makes no sense.

Thanks!

Nate
 
Back
Top