Ver Mensaje Individual
  #49 (permalink)  
Antiguo 09/05/2011, 11:22
cualquiera
 
Fecha de Ingreso: febrero-2007
Mensajes: 232
Antigüedad: 17 años, 2 meses
Puntos: 1
Respuesta: Seleccionar orden de elementos de la lista

asi esta el acrchivo actualizar orden

Código PHP:
Ver original
  1. <?php require_once('../Connections/pallki_banner.php'); ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>Untitled Document</title>
  7. </head>
  8.  
  9. <body>
  10. <?php
  11.  
  12. echo "Parámetro orden: ".$_POST['orden'];
  13. parse_str($_POST['orden']);
  14.  
  15. for ($i = 0; $i < count($categoria); $i++){
  16. mysql_select_db($database_pallki_banner, $pallki_banner);
  17. echo "La iteración ".$i." con el codcategoria: ".$categoria[$i];
  18. $query_rs_categoria = "UPDATE categorias SET orden = ".$i."WHERE codcategoria ='".$categoria[$i]."'";
  19. //No se si esta bien del todo puesta la consulta (las comillas y todo eso).
  20. mysql_query($query_rs_categoria, $pallki_banner) or die(mysql_error());
  21.  
  22. }
  23.  
  24. ?>
  25.  
  26.  
  27. </body>
  28. </html>