3 Replies Latest reply on Jun 27, 2010 4:01 AM by David_F57

    Building out dynamic app, need a bit of advice

    djh88ukwb Level 1

      Hello all !

       

      I have been working on a flex app, that makes users sign in.  This is done by checking their username and password against those defined in a mysql database.  A field in this database is "ID" which is a unique, a primary key, to that user.

       

      THe app should then display data only relating to that person.

       

      At the moment i have the app working fine, if in my scripts i define an "ID" number to look for.

       

      I will try to explain some more . .

       

      I am using AMFPHP to popular datagrids with data taken from the same mysql database that was used to log in.  These scripts being used, pull back data only relating to a certain "ID" at the moment this is built into the script.

       

      I want to have it so when the user logs in, flex takes their ID number and then pushes that to all other relevant scripts that are loading data.  SO then when a user logs in, only their data is shown.  As all data in the database is linked to an ID.

       

      For instance:

       

      If i had the following users table - used to log in

      -------------------------------------

      | ID  | Username | Password |

      -------------------------------------

      | 1   | Bob              | pass         |

      | 2   | Carl              | rawr         |

      -------------------------------------

       

      And then the following data table - used to display data

      ----------------------------------

      | ID | Data               | Link |

      ----------------------------------

      | 1  | This is string 1   | 1    |

      | 2  | This is string 2   | 1    |

      | 3  | This is string 3   | 2    |

      | 4  | This is string 4   | 2    |

      | 5  | This is string 5   | 1    |

      | 6  | This is string 6   | 2    |

      ----------------------------------

       

      Is it possible to have it so, you log in, using a php script, and then your ID is returned, then fed into some AMFPHP scripts, which will be used to determine which strings you can see?

       

      So that Bob can see String 1 2 and 5 while Carl can see 3 4 and 6

       

      Thanks in advance !