The “Create application from database” is a Flex 3 feature that enable you to create simple applications in few clicks;
Here is an example which use php as back-end and MySql as DataSource:
First of all you have to setup your MySql datasource by creating a database and a table;
Create a database
CREATE DATABASE `users` ;
Create a table:
CREATE TABLE `accounts` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`username` VARCHAR( 16 ) NOT NULL ,
`password` VARCHAR( 16 ) NOT NULL ,
`priviledge` INT( 1 ) NOT NULL
) ENGINE = innodb;
Than create a project that use PHP as server technology:
Right Click on the Flex Navigation Panel -> new -> Flex Project;
Choose the project name and select PHP as Application server type;
Click Next;
Before clicking the Finish button be sure that the Web root folder and Root URL are valid, to do so you can click on Validate Configuration;
Now you can create your application!
Choose Data -> Create Application from Database from the main menu;
Select your project and create a New Connection, give it a name a a description(optional) and check the flag Auto-connect when the wizard is finished;
Setup your connection by filling the TextFields and then click on Test Connection
This is an example of a tipical MySql Connection
Host URL: localhost
Database Name:users
User Name: root
Password: DatabasePasswordForRoot
If your connection is valid you can click finish and return to the main screen where you can select the table and the Primary key;
In this example the Table name is accounts and the primary key is id
Click the Next button;
choose the source folder and the PHP file name and go on;
in this screen you can see all the column of your table and you can choose which one you want to show and on which column enable filtering;
Click on Finish and thats all!!
Publish and enjoy!!!