Ver Mensaje Individual
  #4 (permalink)  
Antiguo 19/10/2005, 11:51
Suyta
(Desactivado)
 
Fecha de Ingreso: septiembre-2004
Mensajes: 360
Antigüedad: 19 años, 7 meses
Puntos: 1
Ay me volví a perder :(

Ahora trato de modificar y actualizar los datos en mi tabla.
El groups.php quedó así:
Código PHP:
<? 

$sqlalt
=("SELECT Country AS COUNTRY, group1 AS G1, group2 AS G2  FROM groups "); 
$resultalt mysql_query($sqlalt$con) or die("Error al leer base de datos: ".mysql_error); 
if (
$rowmysql_fetch_array($resultalt)) 


   echo 
"<TABLE BORDER='1'>"
   echo 
"<TR><TD align='center'><strong><font color=navy><small>Country</small></small></TD><TD  align='center'><small><strong><font color=navy>G1</small></small></TD><TD align='center'><small><font color=navy><strong>G2</small></small></TD></TR>"
   DO 
   { 
if (
$row['G1']==1) {$sel1="checked";} else {$sel1="";}
    if (
$row['G2']==1) {$sel2="checked";} else {$sel2="";}

     echo 
"<TR><TD align='left'><small>".$row["COUNTRY"]."</small></small></TD><TD align='center'><small><form action='update.php' method='post'> <input type='hidden' name='country' value=".$row['COUNTRY']."> <input type='checkbox' name='group1' value='1' {$sel1}></small></small></TD><TD align='center'><small> <input type='checkbox' name='group2' value='1' {$sel2} > </small></small></TD></TR></FORM>"
   } 
   WHILE (
$row=mysql_fetch_array($resultalt)); 
   echo 
"<table><tr><td align='center'> <input type='submit' class='button' name='up_countries' value='Submit'></FORM></td></tr></table>";
   echo 
"\t</tr>\n"
   echo 
"</TABLE>"


?>
Entonces intento procesar la actualización en update.php pero no sé como recorrer esos registros:
Código PHP:
$group1=$_POST['group1'];
$group2=$_POST['group2'];
$group3=$_POST['group3'];
$country=$_POST['country']; 
Por favor socorro otra vez. Muchísimas gracias