youandI
05-28-2007, 06:28 AM
I trying to use a flash ComboBox to decide what table the data is saved to in the MySQL database.
I currently have a flash form with input text fields that send/save the data submitted into MySQL. I am having trouble with the ComboBox.. I dont know how to get flash or php to recognize what option was selected from the ComboBox and to then send it to the correct table.
Please click the link below to see my flash form:
flash combobox (http://www.webdesignhull.lincoln.ac.uk/jecgardner/flash_help/uploadcomboboxhelp.fla)
As you an see there are three options in the ComboBox. gallery1, gallery2 and gallery3. If the user selects gallery3 then I want the information to send just to gallery3 and not the other db tables.
Any ideas how I can do this please?
The following PHP uploads the data that is entered in the flash form input fields but not the combobox:
<?php
//Capture data from $_POST array
$image = $_POST['image'];
$gallery1 = $_POST['$gallery1_ID'];
$gallery2 = $_POST['gallery2_ID'];
$gallery3 = $_POST['gallery3_ID'];
$comments = $_POST['comments'];
//Connection to database
$connect = mysql_connect("localhost", "USERNAME","PASSWORD");
mysql_select_db ("DB_USERNAME", $connect);
//Perform the query
$result1 = mysql_query("INSERT into gallery1 (gallery1_ID, image , comments) values ('$gallery1_ID', '$image', '$comments')"); if($result1) echo "writing=Ok&";
else echo "writing=Error";
$result2 = mysql_query("INSERT into gallery2 (gallery2_ID, image , comments) values ($gallery2_ID', '$image', '$comments')"); if($result1) echo "writing=Ok&";
else echo "writing=Error";
$result3 = mysql_query("INSERT into gallery3 (gallery3_ID, image , comments) values ($gallery3_ID', '$image', '$comments')"); if($result1) echo "writing=Ok&";
else echo "writing=Error";
?>
I currently have a flash form with input text fields that send/save the data submitted into MySQL. I am having trouble with the ComboBox.. I dont know how to get flash or php to recognize what option was selected from the ComboBox and to then send it to the correct table.
Please click the link below to see my flash form:
flash combobox (http://www.webdesignhull.lincoln.ac.uk/jecgardner/flash_help/uploadcomboboxhelp.fla)
As you an see there are three options in the ComboBox. gallery1, gallery2 and gallery3. If the user selects gallery3 then I want the information to send just to gallery3 and not the other db tables.
Any ideas how I can do this please?
The following PHP uploads the data that is entered in the flash form input fields but not the combobox:
<?php
//Capture data from $_POST array
$image = $_POST['image'];
$gallery1 = $_POST['$gallery1_ID'];
$gallery2 = $_POST['gallery2_ID'];
$gallery3 = $_POST['gallery3_ID'];
$comments = $_POST['comments'];
//Connection to database
$connect = mysql_connect("localhost", "USERNAME","PASSWORD");
mysql_select_db ("DB_USERNAME", $connect);
//Perform the query
$result1 = mysql_query("INSERT into gallery1 (gallery1_ID, image , comments) values ('$gallery1_ID', '$image', '$comments')"); if($result1) echo "writing=Ok&";
else echo "writing=Error";
$result2 = mysql_query("INSERT into gallery2 (gallery2_ID, image , comments) values ($gallery2_ID', '$image', '$comments')"); if($result1) echo "writing=Ok&";
else echo "writing=Error";
$result3 = mysql_query("INSERT into gallery3 (gallery3_ID, image , comments) values ($gallery3_ID', '$image', '$comments')"); if($result1) echo "writing=Ok&";
else echo "writing=Error";
?>