Link to home
Start Free TrialLog in
Avatar of brettacvh
brettacvh

asked on

Simple flash/php form to create database

I need to create a simple form in flash that a user will fill out and on submit will create a new database and fill it with the form data using php and mqsql. Does anyone have some sample code to this effect?
SOLUTION
Avatar of Dushan Silva
Dushan Silva
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brettacvh
brettacvh

ASKER

To be a bit more detailed I need my flash form to run the following kind of query:

CREATE TABLE  `new`.`users` (
  `test_uid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `test_email` varchar(100) NOT NULL,
  `test_address` varchar(45) DEFAULT NULL,
  `test_message` varchar(45) DEFAULT NULL,
  `ipaddress` varchar(45) DEFAULT NULL,
  `test_pword` char(20) NOT NULL,
  `test_gname` char(80) NOT NULL,
  `test_lname` char(80) NOT NULL,
  `test_active` char(1) DEFAULT 'y',
  `test_lvl` int(10) unsigned NOT NULL DEFAULT '1',
  `test_rdate` datetime DEFAULT NULL,
  `test_username` varchar(45) NOT NULL,
  `test_permission` varchar(45) NOT NULL DEFAULT '1',
  `test_contactno` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`pogu_uid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1

Open in new window


but I'm not sure how to structure the php.

For the flash I guess I'll be using something like this:

submit1.onPress = function(){
	myData.test_uid_txt = test_uid_txt.text
		myData.test_email_txt = test_email_txt.text
		myData.test_address_txt = test_address_txt.text
		myData.sendAndLoad("form.php", myData, "POST")
	}
}

Open in new window

 ... etc
Apologies. I am incorrect. I don't need to be creating the database but rather updating an existing database with:

insert into users(pogu_username,
pogu_pword, 
pogu_gname, 
pogu_lname, 
pogu_gender, 
pogu_rdate, 
pogu_contactno,
pogu_email,
pogu_dob, 
pogu_address, 
pogu_message,
ipaddress)

Open in new window

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To add to my question: how do I validate the radio buttons in the flash form? I have 2 radio buttons with a group name of my_vars.gender The code I am trying is

if (my_vars.gender.selection == undefined) 
		{
			error_clip.gotoAndStop(44);
		}

Open in new window



but doesn't work