2 Replies Latest reply on Mar 28, 2010 4:00 AM by Matt Le Fevre

    pls help.. xml parsing and datagrid problem.. :(


      i am building a small application using flex, php and mysqli...


      i am trying to connect a datagrid to a php.. the php parses a xml data to the flex... but when i execute the program the datagrid doesnt get populated.. can any one help me.. here r my code snippets..



      the database name is crm, table name is leads..


      column names are company, fname and lname respectively..



          echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
          $conn = mysqli_connect('localhost', 'root', '', 'crm');
          $query = "SELECT * from leads";
          $result = mysqli_query($conn, $query);
          echo "<leadsxml>";
          while($row = mysqli_fetch_object($result))
              echo "<leads><leadCompany>" . $row->company . "</leadCompany><leadFirstName>" . $row->fname . "</leadFirstName><leadLastName>" . $row->lname . "</leadLastName></leads>";

          echo "</leadsxml>";



      and the flex part

      <?xml version="1.0" encoding="utf-8"?>
      <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" >

          <mx:HTTPService url = "getlead.php" id = "getleadHS" showBusyCursor="true" useProxy="false" method = "POST"/>
          <mx:DataGrid id = "leadDataGrid" width="400" height="240" dataProvider="{getleadHS.lastResult.leadsxml.leads}">
                  <mx:DataGridColumn headerText="Company" dataField="leadCompany"/>
                  <mx:DataGridColumn headerText="First Name" dataField="leadFirstName"/>
                  <mx:DataGridColumn headerText="Last Name" dataField="leadLastName"/>

      pls someone help me...