Los campos en la base de datos se llaman igual a las variables pero sin la \"v\" al final, creo q no importa el nombre en la tabla sino el orden en que se colocan para ser insertados.
MUCHAS GRACIAS POR LA ASISTENCIA PRESTADA
aquí les publico los 2 códigos:
- Flash:
sexo.maxChars = 1;
fechanac.maxChars = 10;
fechanac.text = \"aaaa-dd-mm\";
enviar = function () {
myLoadVars = new LoadVars();
if (email.text == \'\') {
email.text = \"Inserta un Email válido\";
} else if (nombre.text == \'\') {
nombre.text = \"Inserta un Nombre válido\";
} else if (apellido.text == \'\') {
apellido.text = \"Inserta un Apellido válido\";
} else if (direccion.text == \'\') {
direccion.text = \"Inserta una Dirección válida\";
} else if (pais.text == \'\') {
pais.text = \"Inserta un País válido\";
} else if (fechanac.text == \'\') {
fechanac.text = \"Inserta una Fecha válida\";
} else {
myLoadVars.sendAndLoad(\"http://www.geodestinos.com/insert.php\", \"myLoadVars\", \"POST\");
myLoadVars.emailv = email.text;
myLoadVars.nombrev = nombre.text;
myLoadVars.apellidov = apellido.text;
myLoadVars.direccionv = direccion.text;
myLoadVars.paisv = pais.text;
myLoadVars.fechanacv = fechanac.text;
myLoadVars.sexov = sexo.text;
myLoadVars.onLoad = function() {
if (this.correcto == \"ok\") {
mensaje.text = \"Registro Satisfactorio\";
nombre.text = \"\";
email.text = \"\";
apellido.text = \"\";
pais.text = \"\";
direccion.text = \"\";
fechanac.text = \"\";
sexo.text = \"\";
} else {
mensajev.text = \"No se pudo realizar el registro, intenta de nuevo\";
}
};
}
};
borrar = function () {
nombre.text = \"\";
email.text = \"\";
apellido.text = \"\";
pais.text = \"\";
direccion.text = \"\";
fechanac.text = \"\";
sexo.text = \"\";
};
enviar_btn.onRelease = enviar;
borrar_btn.onRelease = borrar;
Y AQUI EL PHP
<?PHP
//conexión a la base de datos
$host = \"localhost\";
$user = \"*********\";
$pass = \"********\";
$bbdd = \"*********\";
$conexion = mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($bbdd,$conexion) or die(mysql_error());
//Inserción de datos
$Query = \"INSERT into usuarios values (\'0\', \'\"$_POST[\'emailv\']\"\', \'\"$_POST[\'nombrev\']\"\', \'\"$_POST[\'apellidov\']\"\' \'\"$_POST[\'direccionv\']\"\', \'\"$_POST[\'paisv\']\"\', \'\"$_POST[\'fechanacv\']\"\', \'\"$_POST[\'sexov\']\"\')\";
mysql_db_query ($bbdd ,$Query ,$conexion)
echo (\"$correcto = \"ok\");
mysql_close($conexion)
?>
