# Table is not getting updated

**URL:** <https://forum.kirupa.com/t/table-is-not-getting-updated/284427>\
**Category:** flash\
**Created:** [March 19, 2009, 5:40am UTC](https://forum.kirupa.com/t/table-is-not-getting-updated/284427 "2009-03-19T05:40:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nupur2609](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@nupur2609](https://forum.kirupa.com/u/nupur2609)\
**Post date:** [March 19, 2009, 5:40am UTC](https://forum.kirupa.com/t/table-is-not-getting-updated/284427/1 "2009-03-19T05:40:27Z")

</div>

Hi  
I am trying to update a table in my database by sending the variables from actionscript to PHP,but the table is not getting updated.There are no errors at all.  
My code is below:

\*_ **fla code** _

OK\_btn.addEventListener(MouseEvent.CLICK,Submit);  
function Submit(event:MouseEvent):void{  
OK\_btn.visible=false;  
var myRequest:URLRequest = new URLRequest(“DBStore.php”);  
var variables:URLVariables=new URLVariables();  
var sVF,sVB,sAF,sAB,sTotal:String;  
var Total=digit+vbdigit+afdigit+abdigit;

```
        variables.VF="5";
        variables.VB="6";
        variables.AF="8";
        variables.AB="9";
        
        variables.Total="15";
        
        myRequest.method=URLRequestMethod.POST;
        myRequest.data=variables;
        var myLoader:URLLoader=new URLLoader();
        myLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
        myLoader.addEventListener(Event.COMPLETE, onLoaded);

        trace(variables);
        try 
        {
            myLoader.load(myRequest);
        } 
        catch (error:Error) 
        {
            trace('Unable to load requested document.');
        }

```

myLoader.addEventListener(Event.COMPLETE, onLoaded);  
function onLoaded(e:Event):void  
{  
var loader:URLLoader=URLLoader(e.target);  
var vars:URLVariables=new URLVariables(loader.data);  
Test.text=vars.answer;  
if(vars.answer==“ok”)  
{  
trace(“ok”);

```
        }
        else if(vars.answer=="nope")
        {
        trace("nope");
        }
    }

```

}

\*_ **php code** _  
\<?php

/\*\*\*\*\*\*\*\* CHANGE YOUR DATABASE SETTING \*\*\*\*\*\*\*/

$dbhost = ‘205.178.146.76’; // database host

$dbuser = ‘user’; // database username

$dbpass = ‘pwd’; // database password

$dbname = ‘DB’; // database name

$mysql = mysql\_connect($dbhost,$dbuser,$dbpass);

mysql\_select\_db($dbname);

/\* VARIABLES FROM FLASH \*/

$tVF=$\_POST[‘VF’];

$tVB=$\_POST[‘VB’];

$tAF=$\_POST[‘AF’];

$tAB=$\_POST[‘AB’];

$tTotal=$\_GET[‘Total’];

/_INSERT INTO DB_/

$Query=“INSERT INTO Score( ID.VF, VB, AF, AB, Final )VALUES (”",’".$tVF."’, ‘".$tVB."’, ‘".$tAF."’, ‘".$tAB."’, ‘".$tTotal."’)";  
);  
;

/\* ECHO TO FLASH \*/

if(mysql\_query($Query))

{

```
$answer='ok';
    
echo "answer=".$answer;

```

}  
else

{  
$answer=‘nope’;

```
echo "answer=".$answer;
}

```

?\>

Please Tell me where I am going wrong…Have been banging my head with this code for the past 2 days…  
HELP!!!
