emilioestevezz
09-01-2004, 05:06 AM
Hi, im trying to build a flash form that pass som data to a mysql server database iīve been reading some tutorials and i made the actionscript for the submit(=grabar in spanish) button so that it colects data and send it to the server. (i have a form with textfield that is where people enter data, and 2 combobox, one for selecting a personīs name and the other to select a place).
but im having the same record duplicated on the database, but, the first record is complete and the duplicate itīs the same but for the two selections of the 2 combobox that are missing. As a result of running the form an loading data normally i then get on the database 2 records added the are equal but one of them has no combobox data.
I think the problem is definitly the combo box code that i use cos after using it the script worked perfectly maybe someone can help me with it. And also i īve found some tutorials for showing a mysql database content with flash but they are really difficult, some of they se PHPObject and others just tones of actionscript code, isnīt an easyier way for doing it??
Hereīs the script:
on (release) {
if (apellido =="") {
status = "Debe llenar el apellido del cliente!";
} else if (nombre =="") {
status = "Debe llenar el nombre del cliente!";
} else if (fecha =="") {
status = "Debe llenar la fecha de la entrevista!";
} else if (hora =="") {
status = "Debe llenar la hora de la entrevista!";
} else if (asunto =="") {
status = "Debe llenar el asunto del cliente!";
}else{
userData = new LoadVars();
userData.apellido = apellido;
userData.nombre = nombre;
userData.telefono = telefono;
userData.dni = dni;
userData.fecha = fecha;
userData.hora = hora;
userData.asunto = asunto;
userData.abogado = "";
userData.donde = "";
userData.abogado = abogado_cb.getValue();
userData.donde = donde_cb.getValue();
userData.send("inserta.php", "this", "POST");
getURL("inserta.php","this","POST");
status = "Datos Guardados!";
apellido = "";
nombre = "";
dni = "";
telefono = "";
fecha = "";
hora = "";
asunto = "";
}
}
Thanks.
Emilio
but im having the same record duplicated on the database, but, the first record is complete and the duplicate itīs the same but for the two selections of the 2 combobox that are missing. As a result of running the form an loading data normally i then get on the database 2 records added the are equal but one of them has no combobox data.
I think the problem is definitly the combo box code that i use cos after using it the script worked perfectly maybe someone can help me with it. And also i īve found some tutorials for showing a mysql database content with flash but they are really difficult, some of they se PHPObject and others just tones of actionscript code, isnīt an easyier way for doing it??
Hereīs the script:
on (release) {
if (apellido =="") {
status = "Debe llenar el apellido del cliente!";
} else if (nombre =="") {
status = "Debe llenar el nombre del cliente!";
} else if (fecha =="") {
status = "Debe llenar la fecha de la entrevista!";
} else if (hora =="") {
status = "Debe llenar la hora de la entrevista!";
} else if (asunto =="") {
status = "Debe llenar el asunto del cliente!";
}else{
userData = new LoadVars();
userData.apellido = apellido;
userData.nombre = nombre;
userData.telefono = telefono;
userData.dni = dni;
userData.fecha = fecha;
userData.hora = hora;
userData.asunto = asunto;
userData.abogado = "";
userData.donde = "";
userData.abogado = abogado_cb.getValue();
userData.donde = donde_cb.getValue();
userData.send("inserta.php", "this", "POST");
getURL("inserta.php","this","POST");
status = "Datos Guardados!";
apellido = "";
nombre = "";
dni = "";
telefono = "";
fecha = "";
hora = "";
asunto = "";
}
}
Thanks.
Emilio