sorting sql with a mouse drag

sorting sql with a mouse drag

I'm new with jquery and cannot find the right words for finding what i want.

I want a table that can be sorted one row at a time by moving it up and down with dragging.
after dragged, the result should saved to sql. Lets say that the row has own data in sql "sort_order"
what is int number.

how could this be done ?

this seemed nice, but no sql and moves sideways also:

This one seemed like a real deal, but couldn't find a help how to save the order with php to mysql