Reputation: 113
I am trying to create a query from Flash Builder to PHP/mySQL with selectedItems. I have a simple SELECT query set up to populate a datagrid of items I would like to select for main query (two records looks something like this "19 10","20 10"). This is where I get stuck. I don't know if I need to break down the selectedItems in Flash Builder for formatting in SQL or if I can do it in PHP.
I would assume that it should be done in Flash Builder and I would then send the partial SQL statement to PHP.
As of right now, Flash Builder is holding the selected values as CustomObjects and I unsure of how to retrieve what is in the objects for formatting.
var arr:Array = dataGrid.SelectedItems
This yields an array of CustomObjets and I lost from there.
I will need the resulting SQL statement would need to look something like this.
SELECT *
FROM Stats
WHERE neu IN ('19 10','20 10');
Thank you for your help in advance.
Upvotes: 1
Views: 383
Reputation: 1165
you need to look into AMFPHP. It allows you to send data to and from flash/flex to php and back. In php once you receive the data you can use it like any other object in flash to build your sql statement.
I would not construct the sql statement in flash since someone might inject some nastiness in your sql.
http://www.amfphp.com ... There are others version of AMF that you could also use like CakePHP and Zend. FlashBuilder actually will create the ZendAMF sample class for you. But you don't have to use flex to get access to AMF but I would recommend it for any web app. Flash is for animation, flex is for apps.
Upvotes: 1