Código PHP:
<?php
// connect to the database and select the correct database
mysql_connect(hostname,username,password);
mysql_select_db(database) or die("Unable to select database");
// find out how many records there are to update
$size = count($_POST['bookinfo']);
// start a loop in order to update each record
$i = 0;
while ($i < $size) {
// define each variable
$bookinfo= $_POST['bookinfo'][$i];
$id = $_POST['id'][$i];
// do the update and print out some info just to provide some visual feedback
// you might need to remove the single quotes around the field names, for example bookinfo = '$bookinfo' instead of `bookinfo` = '$bookinfo'
$query = "UPDATE table SET `bookinfo` = '$bookinfo' WHERE `id` = '$id' LIMIT 1";
mysql_query($query) or die ("Error in query: $query");
print "$bookinfo<br /><br /><em>Updated!</em><br /><br />";
++$i;
}
mysql_close();
?>
Código PHP:
$size = count($_POST['CodPregunta']);
$i = 0;
while ($i < $size) {
$updateSQL = sprintf("UPDATE generar SET Calificacion=%s WHERE Num_Auditoria=%s AND numpregunta=%s",
GetSQLValueString($_POST['CmbCalifica'], "int"),
GetSQLValueString($_POST['numero1'], "int"),
GetSQLValueString($_POST['CodPregunta'], "int"));
mysql_select_db($database_Audito, $Audito);
$Result1 = mysql_query($updateSQL, $Audito) or die(mysql_error());
++$i;
}
si alguien me puede echar una mano para corregir mi código o indicarme si esta ok o como corregirlo se lo agradeceré.