Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/04/2010, 21:11
Sofmundi
 
Fecha de Ingreso: enero-2010
Mensajes: 302
Antigüedad: 14 años, 3 meses
Puntos: 3
Guardar informacion

Tengo lo siguiente necesito guardar datos en dos tablas distintas y el unico campo en comun es el de empresa el cual debe tomar el codigo de un texbox y guardarlo, pues en teoria lo tengo asi pero no me funciona hay alguna otra solucion ?

Código PHP:
           $insertSQL sprintf("INSERT INTO vehiculo (empresa, codigo, matricula, tipo, marca, modelo, kilometros, horas, min, fecha_matricula, fecha_alta, fecha_baja, localizacion, remolque, en_servicio, averiado, taller, accidente, baja_definitiva) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       
GetSQLValueString($_POST['empresa'], "text"),
                       
GetSQLValueString($_POST['code'], "text"),
                       
GetSQLValueString($_POST['matricula'], "text"),
                       
GetSQLValueString($_POST['tipo'], "text"),
                       
GetSQLValueString($_POST['marca'], "text"),                
                       
GetSQLValueString($_POST['modelo'], "text"),
                       
GetSQLValueString($_POST['kilometros'], "text"),
                       
GetSQLValueString($_POST['horas'], "text"),
                       
GetSQLValueString($_POST['minutos'], "text"),
                       
GetSQLValueString($_POST['fecha_matricula'], "date"),
                       
GetSQLValueString($_POST['fecha_alta'], "date"),
                       
GetSQLValueString($_POST['fecha_baja'], "date"),
                       
GetSQLValueString($_POST['localizacion'], "text"),
                       
GetSQLValueString($_POST['remolque'], "text"),
                       
GetSQLValueString($_POST['en_servicio'], "text"),
                       
GetSQLValueString($_POST['averiado'], "text"),
                       
GetSQLValueString($_POST['taller'], "text"),
                       
GetSQLValueString($_POST['accidente'], "text"),
                       
GetSQLValueString($_POST['baja_definitiva'], "text"));
                       
                       
$insertSQL_datos sprintf("INSERT INTO datostecnicos (matricula, chasis, cantidad_neumaticos, carroceria, descripcion) VALUES (%s, %s, %s, %s, %s)",
                       
GetSQLValueString($_POST['matricula'], "text"),
                       
GetSQLValueString($_POST['chasi'], "text"),
                       
GetSQLValueString($_POST['neumaticos'], "text"),
                       
GetSQLValueString($_POST['carroceria'], "text"),
                       
GetSQLValueString($_POST['descripcion'], "text")); 
les agradeceria a q me ayudaran a realizar los siguiente no se como guardarlo si por GetSQLValueString($_POST['matricula'], "text"), o GetSQLValueString($_GET['matricula'], "text"), cual sera ? o alguna otra forma gracias