I have a flash form with a submit buttton that sends the data to PHP. then PHP inserts the data from the form into MySQL. it works fine for the text fields but the combo box data is blank in mySQL. I echoed the combo box in flash output and the data that I clicked is there. when i try to echo in PHP, I get a syntax error. There must be a special way to code combo box data in PHP.
Here's the code in flash on the submit button that passes the data to PHP:
on (release) {
loadVariablesNum ("reg.php", "0", "Post");
}
Here's the PHP code:
<?PHP
//Collect data from the form
$Facct=($_POST['Facct']);
$Fdate=($_POST['Fdate']);
$ComboBox=($_POST['OrderA']);
//Make a MySQL Connection
$connection = mysql_connect("localhost", "namehere", "passwdhere");// or die(mysql_error());
mysql_select_db("dbasenamehere");// or die(mysql_error());
//echo "Connected to Database<br />";
//Insert into MySql
mysql_query("INSERT INTO account(`SaleNumber`, `Date`, `AccountNumber`,
`Order`)
VALUES(NULL,'$Fdate','$Facct','$ComboBox')");
//Error handling
if ( ! ($result = mysql_query($sql)))
{
print '&error='.mysql_error();
}
else
{
print '&success=1';
}
//Close connection to Mysql
mysql_close($connection);
?>
Thanks for your help.
Koit800