Advertisements

Drag n Drop

Postby typomaniac » Sat Mar 10, 2012 12:58 am

Offline
typomaniac
Posts: 2
Joined: Sat Mar 10, 2012 12:27 am
I need to know how to take a list which originates in a mysql db and use drag n drop to reorder the list(or even as shown below...reorder table cells) and save it to the database. The scheme for getting the list is no problem but I'm lost past that point.

<table>

[code]my $sth=$dbh->prepare("SELECT list_item,list_order from table");
$sth->execute();
while($ref=$sth->fetchrow_hashref()){

print qq~
<tr>
<td>
$ref->{'list_item'}
</td>
</tr>
~;
}
print qq~
</table>
~;[/code]
My project is to build a photo gallery and I have the workings in mind how to do it but this part has me stuck. Any guidance would sure be appreciated.