List:General Discussion« Previous MessageNext Message »
From:Ricardo Fitzgerald Date:May 22 0102 9:30pm
Subject:Syntax dilemma
View as plain text  
Hi,

I'm having trouble trying to insert form data into a mysql db, the
thing is my client wants table data to be splitted, I mean some data 
comes from the first form, and the rest from another form.
This is a portion of the php script.

// Add together proper fields to enter birth date
$fecha_nac = $ano_nac  + "-" + $mes_nac + "-" + $dia_nac;

// Open mysql db
mysql_select_db("intertur");

// SQL query insert all data into a table
$query = "insert into RegistroPersonas values
                ('".NULL."','".$nombre."', '".$apellido."', '".NULL."', '".$direccion."', 
'".$ciudad."', '".NULL."',   '".NULL."', '".$pais."', '".$telefono."', 
'".$fax."', '".$email."', '".$login_usuario."', '".$clave."', 
'".$fecha_nac."',  '".NULL."',  '".NULL."' '".$sexo."',  '".NULL."',  
'".NULL."', '".NULL."', '".NULL."' )";
----> My problem is NOTHING gets inserted !!! 
----> I filled all empty fields with NULL values
----> It connects to the db but does nothing else
// Do query  
$result = mysql_query($query);

// this script has a form at the end, where the remaining fields are
// filled
// and calls the next script, where the tables are altered
// there and the empty fields filled with the values retrieved

I suppose to use Update in the next script , to enter remaining
data, but I'm not sure because the first field auto increments, 
and is the primary key. 


TIA

Rick
AXIS Computers
Thread
Syntax dilemmaRicardo Fitzgerald3 Jun
  • Re: Syntax dilemmaZak Greant14 Jun