Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/05/2007, 23:35
Mads14
 
Fecha de Ingreso: abril-2007
Mensajes: 92
Antigüedad: 17 años
Puntos: 0
Pregunta Ayuda con el update

Bueno, quiero actualizar 2 campos de una tabla, pero no me ha funcionado. Utilice casi el mismo código para actualizar otro campo y si me funciono, pero era de uno solo... bueno espero puedan ayudar o no sé si se me está pasando algo, al querer actualizar 2 campos en lugar de 1. Saludos!

Código PHP:
<?php

$link 
mysql_connect("localhost""root");
mysql_select_db("diseno"$link);

$i=1;
foreach( 
$HTTP_GET_VARS as $key => $value )
 {
  
$i;     //echo
 
if ($i==1)
  {
   
$i=2;
   
$nc=$value;
  }
 else
   {
   
$i=1;
   
$biblio=$value;
   
"DEBUG: " $nc " -> " $biblio " <br>"//echo
   
if ($biblio=="1" OR $biblio=="2" OR $biblio=="3" OR $biblio=="4")
    {
      
$qry "UPDATE upload SET Clasificacion='".$clas."', Biblioteca='".$biblio."' WHERE NoCuenta = ".$nc."";
      
$qry."<br>"//echo
     
mysql_query($qry) or die(mysql_error());
    }
   else
     echo 
""//No hubo cambios<br>
   
}
 }


$sql "SELECT * FROM upload WHERE Clasificacion  = ' ' ";

$result mysql_query($sql$link);
if (
$row mysql_fetch_array($result)){

echo 
"<center><form method=get><table border = '1'> \n";

echo 
"<td><center><FONT SIZE=1><font face=Arial><b> No. de Cuenta </b></font></font size></center></td>";
echo 
"<td><center><FONT SIZE=1><font face=Arial><b> Nombre </b></font></font size></center></td>";
echo 
"<td><center><FONT SIZE=1><font face=Arial><b> Integrantes </b></font></font size></center></td>";
echo 
"<td><center><FONT SIZE=1><font face=Arial><b> Nombre del Proyecto </b></font></center></font size></td>";
echo 
"<td><center><FONT SIZE=1><font face=Arial><b> Clasificación </b></font></font size></center></td>";
echo 
"<td><center><FONT SIZE=1><font face=Arial><b> Biblioteca </b></font></font size></center></td>";

echo 
"</tr> \n";



$i=0;
do {

echo 
"<tr> \n";


$i++;
echo 
"<td><FONT SIZE=1><font face=Arial>".$row["NoCuenta"]."</font></font size> <input type=hidden name=nocta$i value=".$row["NoCuenta"]."></td> \n";
echo 
"<td><FONT SIZE=1><font face=Arial>".$row["Nombre"]."</font></font size></td> \n";
echo 
"<td><FONT SIZE=1><font face=Arial>".$row["Integrantes"]."</font></font size></td> \n";
echo 
"<td><FONT SIZE=1><font face=Arial>".$row["NombreProyecto"]."</font></font size></td> \n";
echo 
"<td><FONT SIZE=1><font face=Arial><input name=Clasificacion type=text></font></font size></td> \n";
echo 
"<td><FONT SIZE=1><font face=Arial><select name=Biblioteca$i>
  <option value=1>1</option>
  <option value=2>2</option>
  <option value=3>3</option>
  <option value=4>4</option>
<option selected></option>

  </font></font size></td> \n"
;
echo 
"<td><a></a></td> \n";

echo 
"<tr> \n";
echo 
"</tr> \n";


} while (
$row mysql_fetch_array($result));

echo 
"</table></center> \n";
echo 
"<input type=submit value=Enviar>"


}

?>
Saludos, Gracias!