Ver Mensaje Individual
  #3 (permalink)  
Antiguo 31/07/2012, 00:23
vicluber
 
Fecha de Ingreso: agosto-2009
Mensajes: 51
Antigüedad: 14 años, 8 meses
Puntos: 1
Respuesta: Consulta mysql en evento jquery

Creo TENGO, que hacerlo con "tableDnD" porque tengo que aplicarlo sobre una tabla <table>...

js

Código:
$(document).ready(function() {
	$('#table-1').tableDnD({
                onDragClass: "dragrow",
		onDrop: function(table, row) {
                // get the serialized data for transport
		serial = $.tableDnD.serialize();
                       // use jQuery ajax function to send information
			$.ajax({
				type: "POST",
				url: "test.php",
				data: serial,
			});
		}
	});
});
test.php

Código:
<?php

include("conexion.php");
$link=Conectarse();

$table_1[] = $_POST['table-1'];
print_r($table_1);
$i = 0;
if(!empty($table_1[0])){
	foreach($table_1 as $value) {
		foreach($value as $row){
			$i++;
			mysql_query("UPDATE productos SET orden='.$i.' WHERE id_producto = '.$row.'", $link);
		}
	}
}
?>
Así es como lo tengo pero no doy pie con bola. Realmente necesito ayuda.

Saludos!