How to update the database when reordering list by sortable

1

Daew lads, I'm using the sortable to reorder a list. How do I make the change in the bank within the function? Here is my code:

 <?php
    session_start();
    if ($_SESSION['clienteLogado']=="") {
        header("Location:login.php");
    }
    require_once("function.php");

    $idPesquisa=$_GET['id'];

    $sql = "SELECT * FROM pergunta p WHERE pesq_id=". $idPesquisa . " and perg_exclusao = 1 order by perg_ordem";
    $resultado = $MySQLi->query($sql) OR trigger_error($MySQLi->error, E_USER_ERROR);

?>

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
        <script src="//code.jquery.com/jquery-1.10.2.js"></script>
        <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
        <script>
            $(function() {
            $("#sortable").sortable({
                stop: function(event, ui) {

                 //REORDENAÇÃO

                }
            });
            $( "#sortable" ).disableSelection();
            });

    </script>

Vlw for the help!

    
asked by anonymous 19.01.2016 / 17:30

0 answers