Link to home
Start Free TrialLog in
Avatar of MarianneEire
MarianneEire

asked on

How to search through phpmyadmin database and render in a datagrid in Adobe Flex??

I am using Flex 4 and phpmyadmin. I have my database connected to my flex project and i can render items from my database into a datagrid in my project. However i want to be able to create a search engine. In other words i want to be able to type the name of an item into a text box and then that item would be shown in my datagrid.

The names of the fields in my database are for example, Product_Name, Product_Type, Product_Desc, Product_ID, Product_SN. I would like to search by Product_Type.

Does anyone have any idea how i would go about doing this??

Hope someone can help!
Marianne
Avatar of CyanBlue
CyanBlue
Flag of United States of America image

I think you've got to take the Flex out of the picture for a sec until you get the backend stuff straightened out first...

This is what I would do...

#1. Set up the database... (Sounds like you've got that done already...)
#2. Create a PHP script that takes an argument and returns the query result back...

Once that part is done, you can go back to Flex and create a stage with textField, button and the datagrid where you call PHP script with the content of the textField as an argument and create a data provider that you get from PHP to feed into the datagrid...

But it sounds like you are basically stuck with the #2 at the moment, and I think you might want to go through some of the tutorials to get that part running...
   http://www.w3schools.com/PHP/php_mysql_where.asp
   http://www.webdevelopersnotes.com/tutorials/sql/mysql_tutorial_selecting_data_using_conditions.php3
   http://www.developerfusion.com/article/3998/mysql-tutorial/7/

CyanBlue
Avatar of MarianneEire
MarianneEire

ASKER

Yup you are right i am stuck at no.2...
Thanks for your advice, i will take a look at those links.. and let you know how it goes!!


:)
Sounds good...  ;)

CyanBlue
Okay so those links were very informative .. thank you!.. Great websites... :D

My problem is working with flex 4 .. i was working with flex 3 previously until i had no choice but to change and use 4 ... (long story short, my windows crashed (virus) had to switch to my mac)

Do you have any knowledge with flex 4 / 3... cause the thing is, in flex 3 when i imported a database into my project it automatically generated something like a search engine. However this does not happen in Flex 4. Have you any idea how i would go about creating this in Flex 4??

Marianne
I am using FlashBuilder 4 but I have never used such functionality before...  Probably that's because I only do AS3 projects in FB4...
Do you have a link to Adobe livedocs which shows such FB3 feature so that I know what you are referring to???

CyanBlue
http://livedocs.adobe.com/flex/3/html/help.html?content=data_3.html

This would be something similar to what i am trying to explain to you!
When importing a database in flex 3, it displays a datagrid , a search function, the ability to delete an item and also to update an item in the database.

All i want to be able to use is the search functionality, however i just don't know how in Flex 4, i don't really know how to use Data Services correctly.

Really appreciate any help you can give on this..
Marianne
ASKER CERTIFIED SOLUTION
Avatar of CyanBlue
CyanBlue
Flag of United States of America 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