Ver Mensaje Individual
  #8 (permalink)  
Antiguo 13/05/2007, 16:06
Mads14
 
Fecha de Ingreso: abril-2007
Mensajes: 92
Antigüedad: 17 años
Puntos: 0
Re: Ayuda con el update

Pues aqui traigo algunos cambios que le hice, pero hay algo que se me hace raro...

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;
   
//$clas=$value;
   
"DEBUG: " $nc " -> " $biblio " <br>"//echo
   //"DEBUG: " . $nc . " -> " . $clas . " <br>"; //echo
   
if ($biblio=="1" OR $biblio=="2" OR $biblio=="3" OR $biblio=="4")
    {
      
$qry "UPDATE upload SET Biblioteca='".$biblio."' WHERE NoCuenta = '".$nc."'";
   
$qry."<br>"//echo
     
mysql_query($qry) or die(mysql_error());
    }
   else
     echo 
""//No hubo cambios<br>
   
}
 }

//print_r($_POST);


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

$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$i 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><FONT SIZE=1><input name=Estado type=text></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>"
}

?>
Verán, ya ven que tengo ahorita solo para actualizar Biblioteca, para el cual si me funciona, cuando quite los comentarios de clas que es Clasificación y le puse echo al DEBUG si van al mismo no. de cuenta los 2 campos, hasta ahi va bien, pero al momento de actualizar, no me actualiza ninguno... estoy echa bolas jejeje... por qué de uno si? y de 2 campos no puedo?

Algún comentario?

Ahhh se me olvida

Código PHP:
 $qry "UPDATE upload SET Clasificacion='".$clas."',    Biblioteca='".$biblio."' WHERE NoCuenta = '".$nc."'"
Creo que así lo puse, en vez de tener solo para Biblioteca. Thanks!