Ver Mensaje Individual
  #3 (permalink)  
Antiguo 04/01/2012, 13:33
kaspito
 
Fecha de Ingreso: septiembre-2011
Mensajes: 36
Antigüedad: 12 años, 7 meses
Puntos: 0
Respuesta: problema rarisimo con querys de mysql y variables de PHP

vale ya sta, resuelto:

el javascript queda asi:

var plt = "<?php echo $pltruename ?>";
var order = $(this).sortable("serialize") + '&update=update';
$.post("songframe.php?table="+plt, order, function(theResponse){

y el php del final queda asi:

<?php
$array = $_POST['arrayorder'];
$table = $_GET['table];
if ($_POST['update'] == "update"){

$count = 1;
foreach ($array as $idval) {
$queryx = "UPDATE $table SET uid = " . $count . " WHERE id = " . $idval;
mysql_query($queryx) or die('Error, insert query failed');
$count ++;
}

}
?>