2 Replies Latest reply on Aug 9, 2010 5:28 AM by tonibecker

    Retrieve Data MYSQL not showing in Data Grid

    tonibecker

      Hy i'm new to this forum.

      My name is Toni and coming from Germany.

       

      My Question.

       

      I'm developing Wordpress Flex Frontend.

      All the data retrieving via PHP Service in Flashbuilder going right.

      The only issue is with the post_content. Nothing shows in the Data Grid concerning this column.

       

      In MySQL the entry for post_content is type "LONGTEXT" but nothing shows up in the Data Grid.

       

      Some ideas solving this problem?

       

      Thanks Toni

        • 1. Re: Retrieve Data MYSQL not showing in Data Grid
          flexillu10

          tonibecker wrote:

           

          Hy i'm new to this forum.

          My name is Toni and coming from Germany.

           

          My Question.

           

          I'm developing Wordpress Flex Frontend.

          All the data retrieving via PHP Service in Flashbuilder going right.

          The only issue is with the post_content. Nothing shows in the Data Grid concerning this column.

           

          In MySQL the entry for post_content is type "LONGTEXT" but nothing shows up in the Data Grid.

           

          Some ideas solving this problem?

           

          Thanks Toni

           

          when i did something similar i went into design view and just dragged the service onto the datagrid

          • 2. Re: Retrieve Data MYSQL not showing in Data Grid
            tonibecker Level 1

            Everything tried in this direction, i'm thinking it could be a problem while sending data back, cause its ut8_general_ci and have to convert the $row->post_content into workable format.

             

            But the Question is how

             

            Heres my code:

             

            class WppostsService {

             

                var $username = "root";
                var $password = "1111";
                var $server = "localhost";
                var $port = "3306";
                var $databasename = "wp3";
                var $tablename = "wp_posts";

             

                var $connection;

             

                public function __construct() {
                      $this->connection = mysqli_connect(
                                              $this->server, 
                                              $this->username, 
                                              $this->password,
                                              $this->databasename,
                                              $this->port
                                          );

             

                    $this->throwExceptionOnError($this->connection);
                }


                public function getAllWp_posts() {

             

                    $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename");       
                    $this->throwExceptionOnError();
                   
                    mysqli_stmt_execute($stmt);
                    $this->throwExceptionOnError();
                   
                    $rows = array();
                   
                    mysqli_stmt_bind_result($stmt, $row->ID, $row->post_author, $row->post_date, $row->post_date_gmt, $row->post_content, $row->post_title, $row->post_excerpt, $row->post_status, $row->comment_status, $row->ping_status, $row->post_password, $row->post_name, $row->to_ping, $row->pinged, $row->post_modified, $row->post_modified_gmt, $row->post_content_filtered, $row->post_parent, $row->guid, $row->menu_order, $row->post_type, $row->post_mime_type, $row->comment_count);
                   
                    while (mysqli_stmt_fetch($stmt)) {
                      $row->post_date = new DateTime($row->post_date);
                      $row->post_date_gmt = new DateTime($row->post_date_gmt);
                      $row->post_modified = new DateTime($row->post_modified);
                      $row->post_modified_gmt = new DateTime($row->post_modified_gmt);
                      $rows[] = $row;
                      $row = new stdClass();
                      mysqli_stmt_bind_result($stmt, $row->ID, $row->post_author, $row->post_date, $row->post_date_gmt, $row->post_content, $row->post_title, $row->post_excerpt, $row->post_status, $row->comment_status, $row->ping_status, $row->post_password, $row->post_name, $row->to_ping, $row->pinged, $row->post_modified, $row->post_modified_gmt, $row->post_content_filtered, $row->post_parent, $row->guid, $row->menu_order, $row->post_type, $row->post_mime_type, $row->comment_count);
                    }
                   
                    mysqli_stmt_free_result($stmt);
                    mysqli_close($this->connection);
               
                    return $rows;
                }