Warning: sprintf() [function.sprintf]: Too few arguments
Warning: sprintf() [function.sprintf]: Too few arguments in C:AppServwwwFinal.php on line 53
Query was empty
Esto es lo que me salta cuando intento actualizar un registro en un formulario.
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE `detalle partes` SET `TECNICO`=%s, `FECHA REALIZ`=%s, `HORA ENTR`=%s, `HORA SAL`=%s, `TDESPLA`=%s, `INFORME TECNICO`=%s, `SALIDA TALLER`=%s, `MANO DE OBRA`=%s, `DESPLAZAMIENTO`=%s, `SUBTOTAL`=%s, `16%IVA`=%s, `TOTAL`=%s, `HORA`=%s WHERE `ID`=%s AND `id2`=%s AND `CONTROL`=%s",
GetSQLValueString($_POST['tecnico'], "text"),
GetSQLValueString($_POST['f_realizacion'], "date"),
GetSQLValueString($_POST['h_entrada'], "date"),
GetSQLValueString($_POST['h_salida'], "date"),
GetSQLValueString($_POST['t_desplaz'], "time"),
GetSQLValueString($_POST['i_tecnico'], "text"),
GetSQLValueString($_POST['salida_taller'], "double"),
GetSQLValueString($_POST['mano_obra'], "double"),
GetSQLValueString($_POST['desplaza'], "double"),
GetSQLValueString($_POST['subtotal'], "double"),
GetSQLValueString($_POST['iva'], "double"),
GetSQLValueString($_POST['total'], "double"),
GetSQLValueString($_POST['h_utilizadas'], "double"),
GetSQLValueString($_POST['ID'], "int"),
GetSQLValueString($_POST['id2'], "int"),
GetSQLValueString($_POST['control'], "int"));
mysql_select_db($database_conex, $conex);
$Result1 = mysql_query($updateSQL, $conex) or die(mysql_error());
$nserie2 = "'".$_POST['select']."'";
$updateGoTo = "Finalaux.php?recordID=".$recordID."&nserie=".$nserie2."&CC=".$CC;
if (isset($_SERVER['QUERY_STRING'])) {
//$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
//$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
Esta es la funcion de actualizar ... creo que esta bien, ya que me la genera el Dreamweaver el solo. Os pongo la tabla en la que quiero actualizar. Tiene algo que ver el que algunos campos o el nombre de la tabla tengan espacio? por que tengo otras asi pero no me dan error. Y todos los campos que inserto en la orden SQL tienen valor ... asi que ... aver si me podeis ayudar.
TABLA: detalle partes
id1 - int(11) - not null - Primary Key - Auto Increment
ID - int(11) - allow null
id2 - int(11) - allow null
CONTROL - int(11) - allow null
TECNICO - varchar(50) - allow null
FECHA REALIZ - date - allow null
HORA ENTR - time - allow null
HORA SAL - time - allow null
TDESPLA - time - allow null
INFORME TECNICO - longtext - allow null
Añadir Subaviso - tinyint(4) - allow null
KILOMETROS - int(11) - allow null
REFERENCIA - double - allow null
SALIDA TALLER - double - allow null
MANO DE OBRA - double - allow null
DESPLAZAMIENTO - double - allow null
SUBTOTAL - double - allow null
16%IVA - double - allow null
TOTAL - double - allow null
REGISTRADO - tinyint(4) - allow null
idfactura1 - int(11) - allow null
pendfact - tinyint(4) - allow null
HORA - double - allow null
HREGISTRADA - tinyint(4) - allow null
Query was empty
Esto es lo que me salta cuando intento actualizar un registro en un formulario.
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE `detalle partes` SET `TECNICO`=%s, `FECHA REALIZ`=%s, `HORA ENTR`=%s, `HORA SAL`=%s, `TDESPLA`=%s, `INFORME TECNICO`=%s, `SALIDA TALLER`=%s, `MANO DE OBRA`=%s, `DESPLAZAMIENTO`=%s, `SUBTOTAL`=%s, `16%IVA`=%s, `TOTAL`=%s, `HORA`=%s WHERE `ID`=%s AND `id2`=%s AND `CONTROL`=%s",
GetSQLValueString($_POST['tecnico'], "text"),
GetSQLValueString($_POST['f_realizacion'], "date"),
GetSQLValueString($_POST['h_entrada'], "date"),
GetSQLValueString($_POST['h_salida'], "date"),
GetSQLValueString($_POST['t_desplaz'], "time"),
GetSQLValueString($_POST['i_tecnico'], "text"),
GetSQLValueString($_POST['salida_taller'], "double"),
GetSQLValueString($_POST['mano_obra'], "double"),
GetSQLValueString($_POST['desplaza'], "double"),
GetSQLValueString($_POST['subtotal'], "double"),
GetSQLValueString($_POST['iva'], "double"),
GetSQLValueString($_POST['total'], "double"),
GetSQLValueString($_POST['h_utilizadas'], "double"),
GetSQLValueString($_POST['ID'], "int"),
GetSQLValueString($_POST['id2'], "int"),
GetSQLValueString($_POST['control'], "int"));
mysql_select_db($database_conex, $conex);
$Result1 = mysql_query($updateSQL, $conex) or die(mysql_error());
$nserie2 = "'".$_POST['select']."'";
$updateGoTo = "Finalaux.php?recordID=".$recordID."&nserie=".$nserie2."&CC=".$CC;
if (isset($_SERVER['QUERY_STRING'])) {
//$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
//$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
Esta es la funcion de actualizar ... creo que esta bien, ya que me la genera el Dreamweaver el solo. Os pongo la tabla en la que quiero actualizar. Tiene algo que ver el que algunos campos o el nombre de la tabla tengan espacio? por que tengo otras asi pero no me dan error. Y todos los campos que inserto en la orden SQL tienen valor ... asi que ... aver si me podeis ayudar.
TABLA: detalle partes
id1 - int(11) - not null - Primary Key - Auto Increment
ID - int(11) - allow null
id2 - int(11) - allow null
CONTROL - int(11) - allow null
TECNICO - varchar(50) - allow null
FECHA REALIZ - date - allow null
HORA ENTR - time - allow null
HORA SAL - time - allow null
TDESPLA - time - allow null
INFORME TECNICO - longtext - allow null
Añadir Subaviso - tinyint(4) - allow null
KILOMETROS - int(11) - allow null
REFERENCIA - double - allow null
SALIDA TALLER - double - allow null
MANO DE OBRA - double - allow null
DESPLAZAMIENTO - double - allow null
SUBTOTAL - double - allow null
16%IVA - double - allow null
TOTAL - double - allow null
REGISTRADO - tinyint(4) - allow null
idfactura1 - int(11) - allow null
pendfact - tinyint(4) - allow null
HORA - double - allow null
HREGISTRADA - tinyint(4) - allow null