i have two pages the first one select.php shows 4 records when i can modify one value in each one but when i try to modify and goes to the second page upload.php an error ocurres.i try the update in php my admin and it worksError in query:UPDATE lc_t_configuracion SET valor = '11:12' WHERE id_conf =6 LIMIT 1select.php<code><?php# FileName="Connection_php_mysql.htm"# Type="MYSQL"# HTTP="true"$hostname_admin = "localhost";$database_admin = "xxx";$username_admin = "xxx";$password_admin = "xxx";$admin = mysql_pconnect($hostname_admin, $username_admin, $password_admin) or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db("xxx") or die("Unable to select database");$sql = "SELECT * FROM lc_t_configuracion where id_conf between 6 and 9 ORDER BY id_conf";$result = mysql_query($sql) or die($sql."".mysql_error());$i = 0;echo '<table width="50%">';echo '<tr>';echo '<td>ID</td>';echo '<td>Concepto</td>';echo '<td>Valor</td>';echo '</tr>';echo "<form name='form_update' method='post' action='update.php'>";while ($lc_t_configuracion = mysql_fetch_array($result)) {echo '<tr>';echo "<td>{$lc_t_configuracion['id_conf']}<input type='hidden' name='id_conf[$i]' value='{$lc_t_configuracion['id_conf']}' /></td>";echo "<td>{$lc_t_configuracion['concepto']}</td>";echo "<td><input type='text' size='40' name='valor[$i]' value='{$lc_t_configuracion['valor']}' /></td>";echo '</tr>';++$i;}echo '<tr>';echo "<td><input type='submit' value='submit' /></td>";echo '</tr>';echo "</form>";echo '</table>';?></code>update.php<code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Update Table</title></head><body><?php# FileName="Connection_php_mysql.htm"# Type="MYSQL"# HTTP="true"$hostname_admin = "localhost";$database_admin = "xxx";$username_admin = "xxx";$password_admin = "xxx";$admin = mysql_pconnect($hostname_admin, $username_admin, $password_admin) or trigger_error(mysql_error(),E_USER_ERROR); $size = count($_POST['valor']);$i = 0;while ($i < $size) {$valor= $_POST['valor'][$i];$id_conf = $_POST['id_conf'][$i];$query = "UPDATE lc_t_configuracion SET valor = '$valor' WHERE id_conf =$id_conf LIMIT 1";mysql_query($query) or die ("Error in query: $query");echo "$valor<em>Updated!</em>";++$i;}?></body></html></code>Please help me
↧