title: How to populate mysql db details using Extjs grid in php?
body: <p>First in php page I am getting mysql db details and display in console, but I need to populate db details in ExtJs grid.
  Can you help me how to write ExtJs grid with php and how to populate db details .</p>
  
  <pre><code> &lt;?php
    // Install the DB module using 'pear install DB'
    require_once( "db.php" );
  
    $data = array();
  
    $db =&amp; DB::connect("mysql://root@localhost/praveen", array());
    if (PEAR::isError($db)) { die($db-&gt;getMessage()); }
  
  $res = $db-&gt;query( "SELECT * FROM users " );
  
  
    ?&gt;
    &lt;html&gt;
      &lt;link rel="stylesheet" type="text/css" href ="http://localhost:8080/ext/ext-4.2.1.883/resources/css/ext-all.css"/&gt;
      &lt;script type = "text/javascript" src = "http://localhost:8080/ext/ext-4.2.1.883/ext-all-dev.js"/&gt;
  
      &lt;script type="text/javascript"&gt;
          Ext.onReady(function(){
  
              //how to get the populate db details in grid here !
  
          });
      &lt;/script&gt;
    &lt;body&gt;
    &lt;table&gt;
    &lt;tr&gt;
    &lt;th&gt;First Name&lt;/th&gt;
    &lt;th&gt;Middle Name&lt;/th&gt;
    &lt;th&gt;Last Nmae&lt;/th&gt;
  
    &lt;/tr&gt;
    &lt;?php while( $res-&gt;fetchInto( $row, 
              DB_FETCHMODE_ASSOC ) ) { ?&gt;
    &lt;tr&gt;
    &lt;td&gt;&lt;?php echo( $row['firstname'] ); ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php echo( $row['middlename'] ); ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php echo( $row['lastname'] ); ?&gt;&lt;/td&gt;
  
    &lt;/tr&gt;
    &lt;?php } ?&gt;
  
    &lt;/table&gt;
  
   &lt;/body&gt;
    &lt;/html&gt;
  </code></pre>