0 Replies Latest reply on Oct 11, 2007 5:27 AM by JonoB

    New to this...

      Hi all.

      Im a complete newbie when it comes to Flex, and I am just trying it out for the first time.

      I have the following flex and php files, which seem to work fine, with one exception: I cannot see any data in the columns of the datagrid. The data is added when I submit (I check the mysql database,and it is inserted), and the datagrid scrollbar moves to indicate this, but I cant actually see the data at all. When I select any of the rows in the datagrid, the correct email value is shown in the textbox. What am I missing out on?

      Something to do with the DataGridColumn, but I cant figure out what.

      Thanks for any help that you can provide

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

      <mx:HTTPService id="userRequest" url=" http://localhost/flex/php/request.php" useProxy="false"
      <mx:request xmlns="">

      <mx:Form x="22" y="10" width="493">
      <mx:Label text="Username"/>
      <mx:TextInput id="username"/>

      <mx:Label text="Email Address"/>
      <mx:TextInput id="emailaddress"/>

      <mx:Button label="Submit" click="userRequest.send()"/>

      <mx:DataGrid id="gridUserRequest" x="22" y="128"

      <mx:DataGridColumn headerText="User ID" dataField="userid"/>
      <mx:DataGridColumn headerText="User Name" dataField="username"/>

      <mx:TextInput x="22" y="292" id="selectedemailaddress"



      //connect to the database

      $mysql_access = mysql_connect("localhost", "root", "");
      mysql_select_db($dbname, $mysql_access);

      if( $_POST["emailaddress"] AND $_POST["username"])
      //add the user
      $Query = "INSERT INTO users VALUES ('', '".$_POST['username'].
      "', '".$_POST['emailaddress']."')";
      $Result = mysql_query( $Query );
      //return a list of all the users
      $Query = "SELECT * from users";
      $Result = mysql_query( $Query );
      $Return = "<users>";
      while ( $User = mysql_fetch_object( $Result ) )
      $Return .= "<user><userid>".$User->userid."</userid><username>".
      $Return .= "</users>";
      mysql_free_result( $Result );
      print ($Return)