# Problem conecting fla + php + sql

**URL:** https://forum.kirupa.com/t/problem-conecting-fla-php-sql/207478
**Category:** Uncategorized
**Created:** [November 17, 2006, 10:47pm UTC](https://forum.kirupa.com/t/problem-conecting-fla-php-sql/207478 "2006-11-17T22:47:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![FedEx](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@FedEx](https://forum.kirupa.com/u/FedEx)
#### Post date: [November 17, 2006, 10:47pm UTC](https://forum.kirupa.com/t/problem-conecting-fla-php-sql/207478/1 "2006-11-17T22:47:40Z")

</div>

Hi everyone there,

Im having the follwing issue.  
I have a fla connecting to a send.php that should write the database (mysql)  
[FONT=Arial][SIZE=2]  
I have been testing extensively everyhting and i’ve got to the conclusion that something is going on between the fla and the send.php.[/SIZE][/FONT]  
[FONT=Arial][SIZE=2][/SIZE][/FONT]  
[FONT=Arial][SIZE=2][/SIZE][/FONT] [FONT=Arial][SIZE=2]Tests: localhost:3306 is working for sure[/SIZE][/FONT]  
[FONT=Arial][SIZE=2]this is the script in the SEND.PHP (attached at the zip)  
[/SIZE][/FONT]  
[FONT=Arial][SIZE=2]\<?  
$DBhost = “localhost”; //database host  
$DBuser = “root”; //database user  
$DBpass = “pass”; //database pass  
$DBName = “datos”; //database name  
$table = “personas”; //table name[/SIZE][/FONT]

[FONT=Arial][SIZE=2][/SIZE][/FONT]

[FONT=Arial][SIZE=2]$name=trim($nombre);  
$surname=trim($apellido);  
$phone=trim($telefono);  
$identity=trim($ci);  
$mail=trim($email);  
$code=trim($codigo);[/SIZE][/FONT]

[FONT=Arial][SIZE=2][/SIZE][/FONT]

[FONT=Arial][SIZE=2]#Connects to the Database.  
$Connect = mysql\_connect($DBhost, $DBuser, $DBpass);  
@mysql\_select\_db("$DBName");  
$query = @mysql\_query(“INSERT INTO $table (nombre,apellido,telefono,ci,email,codigo) VALUES "  
.”(’$name’,’$surname’,’$phone’,’$identity’,’$mail’,’$code’)");[/SIZE][/FONT]

[FONT=Arial][SIZE=2]?\>[/SIZE][/FONT]  
[FONT=Arial][SIZE=2][/SIZE][/FONT]  
[FONT=Arial][SIZE=2][COLOR=Blue]we’ve replaced[/COLOR] [COLOR=#ff0000]$code=trim($codigo); with [/COLOR][COLOR=Blue]$code=“452987”; and it collects the data on the database, so we’ve got to the conclution that it is not bringing the info from the fla to the php. (check it on [www.promomach3.com/database.php](http://www.promomach3.com/database.php)) id=21 and 22 (the name we’ve inputed dirtectly on the [/COLOR][COLOR=Blue]$query = @mysql\_query(“INSERT INTO $table (nombre,apellido,telefono,ci,email,codigo) VALUES "  
.”(’$name’,’$surname’,’$phone’,’$identity’,’$mail’,’$code’)");[/COLOR][COLOR=Blue] area.[/COLOR][/SIZE][/FONT]  
[FONT=Arial][SIZE=2][/SIZE][/FONT]  
[FONT=Arial][SIZE=2]please check it.

THE SEND BUTTON goes as (the fla attached) has the folloeing coding.

stop();  
\_root.enviar.onRollOver =function() {  
sound = new Sound()  
sound.attachSound(“but”)  
sound.start(0,1)  
}

\_root.enviar.onRelease = function()  
{  
if(\_root.nombre.length == 0 || \_root.telefono.length == 0 || \_root.telefono.length == 0 || \_root.ci.length == 0 || \_root.email.length == 0 || \_root.codigo.length == 0)  
{

```
    _root.proc.text="Por favor, verifique los datos completados.";
    _root.proc1.text="Hay que completar todos los campos.";
    
    }
   else
   {
    myVars = new LoadVars();
    myVars.nombre = _root.nombre.text;
    myVars.apellido = _root.apellido.text;
    myVars.telefono = _root.telefono.text;
    myVars.ci = _root.ci.text;
    myVars.email = _root.email.text;
    myVars.codigo = _root.codigo.text;
    myVars.sendAndLoad("send.php", myVars, "POST");
    _root.nextFrame();

```

}}  
[/SIZE][/FONT]
