简体   繁体   中英

how to load and edit a sql database from adobe flex builder 4.6 air program

Alright I have my sqldb hosted online and can access it using phpmyadmin what i would like to do is create tables and add items to the tables via adobe flex builder 4.6 desktop AIR application.

Anyone know if i am able to do this, the idea for the program is so person at position A can enter a name and person at position B can then use his program to read those names

According to Accessing mysql from Adobe flex/AIR , AIR is unable to access MySQL servers directly, so you'll have to use web services or some custom API do to this. But yeah, sure it's possible to do what you want.

I agree with Isaac. However, I want to add that it is good coding practices to not allow client side applications modify a database directly. In the applications that I have built, I like to use PHP to set-up an API that then interacts with the database. The AIR application then the interaction with the API using HTTP Requests.

Following code shows how to perform a URL request from the Adobe Website. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLRequest.html

        var url:String = url location of the API;
        var request:URLRequest = new URLRequest(url);

        var variables:URLVariables = new URLVariables();  //create variables to pass to the API
        variables.exampleSessionId = new Date().getTime(); //create variables to pass to the API
        variables.exampleUserLabel = "guest";    //create variables to pass to the API
        request.data = variables;               //Add the variables to the request
        request.method = URLRequestMethod.POST; //Set the method of the Request GET, POST, PUT

        navigateToURL(request);                //Executes the request

您可能想要这样的东西https://backendless.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM