1 Reply Latest reply on Sep 29, 2008 5:34 AM by Newsgroup_User

    How can I populate datagrid with a table join / 2 tables ?

    jarmanje
      Hi there,

      I have 2 tables i'd like to get info from:

      Products:
      ProductID
      Price
      Stock

      ProductOrdered:
      OrderID
      ProductID
      quantity
      ColourID

      At the moment, i populate my datagrid by using the 'build application...' built into flex. But this only creates an app that edits one table at a time.

      How would i be able to load info from 2 tables into a flex grid? I want to create an object just like you do when filling the datagrid generated from flex, but instead it has an sql similar to below. If i was going to use flash as3, I would use an sql in the php like this:

      $sql = "SELECT `Products `. Price, `ProductOrdered `.* FROM `Products `, `ProductOrdered ` WHERE `ProductOrdered `. ProductID = `Products `. ProductID;

      i'm new to flex, but learning how to read from the php scripts generated in flex. But this is a bit confusing how i would do this..

      Any advise would be a massive help for me
        • 1. Re: How can I populate datagrid with a table join / 2 tables ?
          Level 7

          "jarmanje" <webforumsuser@macromedia.com> wrote in message
          news:gbp9of$eoo$1@forums.macromedia.com...
          > Hi there,
          >
          > I have 2 tables i'd like to get info from:
          >
          > Products:
          > ProductID
          > Price
          > Stock
          >
          > ProductOrdered:
          > OrderID
          > ProductID
          > quantity
          > ColourID
          >
          > At the moment, i populate my datagrid by using the 'build application...'
          > built into flex. But this only creates an app that edits one table at a
          > time.
          >
          > How would i be able to load info from 2 tables into a flex grid? I want to
          > create an object just like you do when filling the datagrid generated from
          > flex, but instead it has an sql similar to below. If i was going to use
          > flash
          > as3, I would use an sql in the php like this:
          >
          > $sql = "SELECT `Products `. Price, `ProductOrdered `.* FROM `Products `,
          > `ProductOrdered ` WHERE `ProductOrdered `. ProductID = `Products `.
          > ProductID;
          >
          > i'm new to flex, but learning how to read from the php scripts generated
          > in
          > flex. But this is a bit confusing how i would do this..
          >
          > Any advise would be a massive help for me

          There is no rule in Flex that you have to use the scripts made by the
          wizards.