Ver Mensaje Individual
  #5 (permalink)  
Antiguo 07/02/2012, 12:38
chumy_
 
Fecha de Ingreso: noviembre-2011
Mensajes: 121
Antigüedad: 12 años, 5 meses
Puntos: 0
Respuesta: problema al editar formulario

Código PHP:
<?php require_once('Connections/localhost.php'); ?>
<?php 
require_once('Connections/formulario.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  if (
PHP_VERSION 6) {
    
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}

$editFormAction $_SERVER['PHP_SELF'];
if (isset(
$_SERVER['QUERY_STRING'])) {
  
$editFormAction .= "?" htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset(
$_POST["MM_update"])) && ($_POST["MM_update"] == "f1")) {
  
$updateSQL sprintf("UPDATE cert SET poblacion=%s, calle=%s, n=%s, tipo_recinto=%s, n1=%s, pisos=%s, tipo_gas=%s, empresa=%s, artefacto=%s, tipo_artefacto=%s, marca=%s, modelo=%s, n_serie=%s, potencia=%s, ubicacion=%s, volumen=%s, encendido=%s, con_gas=%s, con_agua=%s, comandos=%s, quemadores=%s, conducto_2=%s, sellac2_uni=%s, diseno_mat_c2=%s, carcasa=%s, conjunto_piloto=%s, inter_calor=%s, sist_seguridad=%s, co_corr_ppc_antes=%s, co_corr_ppc_despues=%s, co_amb_ppm_antes=%s, co_amb_ppm_despues=%s, tiro_antes=%s, tiro_despues=%s, cau_agua_f_antes=%s, cau_agua_f_despues=%s, t_agua_f_antes=%s, t_agua_f_despues=%s, cau_agua_t_antes=%s, cau_agua_t_despues=%s, t_agua_t_antes=%s, t_agua_t_despues=%s, valvula_gas=%s, valvula_agua=%s, sensor_revoco=%s, sensor_temp=%s, bobina=%s, red_gas=%s, artefactos=%s, observaciones=%s, nombre=%s, rut1=%s, tel_fijo=%s, tel_celular=%s, correo=%s, obs_de_recep=%s WHERE cod_ver=%s",
                       
GetSQLValueString($_POST['poblacion'], "text"),
                       
GetSQLValueString($_POST['calle'], "text"),
                       
GetSQLValueString($_POST['n'], "text"),
                       
GetSQLValueString($_POST['tipo_recinto'], "text"),
                       
GetSQLValueString($_POST['n1'], "text"),
                       
GetSQLValueString($_POST['pisos'], "text"),
                       
GetSQLValueString($_POST['tipo_gas'], "text"),
                       
GetSQLValueString($_POST['empresa'], "text"),
                       
GetSQLValueString($_POST['artefacto'], "text"),
                       
GetSQLValueString($_POST['tipo_artefacto'], "text"),
                       
GetSQLValueString($_POST['marca'], "text"),
                       
GetSQLValueString($_POST['modelo'], "text"),
                       
GetSQLValueString($_POST['n_serie'], "text"),
                       
GetSQLValueString($_POST['potencia'], "text"),
                       
GetSQLValueString($_POST['ubicacion'], "text"),
                       
GetSQLValueString($_POST['volumen'], "text"),
                       
GetSQLValueString($_POST['encendido'], "text"),
                       
GetSQLValueString($_POST['con_gas'], "text"),
                       
GetSQLValueString($_POST['con_agua'], "text"),
                       
GetSQLValueString($_POST['comandos'], "text"),
                       
GetSQLValueString($_POST['quemadores'], "text"),
                       
GetSQLValueString($_POST['conducto_2'], "text"),
                       
GetSQLValueString($_POST['sellac2_uni'], "text"),
                       
GetSQLValueString($_POST['diseno_mat_c2'], "text"),
                       
GetSQLValueString($_POST['carcasa'], "text"),
                       
GetSQLValueString($_POST['conjunto_piloto'], "text"),
                       
GetSQLValueString($_POST['inter_calor'], "text"),
                       
GetSQLValueString($_POST['sist_seguridad'], "text"),
                       
GetSQLValueString($_POST['co_corr_ppc_antes'], "text"),
                       
GetSQLValueString($_POST['co_corr_ppc_despues'], "text"),
                       
GetSQLValueString($_POST['co_amb_ppm_antes'], "text"),
                       
GetSQLValueString($_POST['co_amb_ppm_despues'], "text"),
                       
GetSQLValueString($_POST['tiro_antes'], "text"),
                       
GetSQLValueString($_POST['tiro_despues'], "text"),
                       
GetSQLValueString($_POST['cau_agua_f_antes'], "text"),
                       
GetSQLValueString($_POST['cau_agua_f_despues'], "text"),
                       
GetSQLValueString($_POST['t_agua_f_antes'], "text"),
                       
GetSQLValueString($_POST['t_agua_f_despues'], "text"),
                       
GetSQLValueString($_POST['cau_agua_t_antes'], "text"),
                       
GetSQLValueString($_POST['cau_agua_t_despues'], "text"),
                       
GetSQLValueString($_POST['t_agua_t_antes'], "text"),
                       
GetSQLValueString($_POST['t_agua_t_despues'], "text"),
                       
GetSQLValueString($_POST['valvula_gas'], "text"),
                       
GetSQLValueString($_POST['valvula_agua'], "text"),
                       
GetSQLValueString($_POST['sensor_revoco'], "text"),
                       
GetSQLValueString($_POST['sensor_temp'], "text"),
                       
GetSQLValueString($_POST['bobina'], "text"),
                       
GetSQLValueString($_POST['red_gas'], "text"),
                       
GetSQLValueString($_POST['artefactos'], "text"),
                       
GetSQLValueString($_POST['observaciones'], "text"),
                       
GetSQLValueString($_POST['nombre'], "text"),
                       
GetSQLValueString($_POST['rut1'], "text"),
                       
GetSQLValueString($_POST['tel_fijo'], "text"),
                       
GetSQLValueString($_POST['tel_celular'], "text"),
                       
GetSQLValueString($_POST['correo'], "text"),
                       
GetSQLValueString($_POST['obs_de_recep'], "text"),
                       
GetSQLValueString($_POST['cod_ver'], "text"));