# \[PHP\] send data from flash to mySQL problem

**URL:** <https://forum.kirupa.com/t/php-send-data-from-flash-to-mysql-problem/173770>\
**Category:** programming\
**Created:** [December 29, 2005, 3:55pm UTC](https://forum.kirupa.com/t/php-send-data-from-flash-to-mysql-problem/173770 "2005-12-29T15:55:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sofajoe](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@sofajoe](https://forum.kirupa.com/u/sofajoe)\
**Post date:** [December 29, 2005, 3:55pm UTC](https://forum.kirupa.com/t/php-send-data-from-flash-to-mysql-problem/173770/1 "2005-12-29T15:55:27Z")

</div>

I’m trying to get a grip on Flash AS and PHP interaction.

## This Flash ActionScript is supposed to send a variable (myData.email) found in a dynamic textbox to a PHP-script (when a button is pushed):

```
myData.name = name;
myData.stime = stime;
myData.score = score;
myData.total = total;
myData.email = email.text;
myData.sendAndLoad("highscore.php", myData, "POST");

```

* * *

## Then this PHP-script is supposed to add this varible to MySQL:

## \<?php //Capture data from $\_POST array $name = $\_POST[‘name’]; $total = $\_POST[‘total’]; $score = $\_POST[‘score’]; $stime = $\_POST[‘stime’]; $email = $\_POST[‘email’]; $date = date(“Y-m-d”); //Connection to database include(“config.php”); $db = @mysql\_connect($host\_name, $user\_name, $host\_password); mysql\_select\_db($db\_name); //Perform the query $sql = “INSERT into `$table_name` (`name`, `stime`, `score`, `total`, ‘email’, `date`) VALUES (’$name’, ‘$stime’, ‘$score’, ‘$total’, ‘$email’, ‘$date’)”; // $res = mysql\_query($sql, $db); ?\>

**The problem is:**  
They all work except the email one?

- when i take off email it all works and my database gets updated.
- when i add it nothing works.

Any suggestions?
