This article mainly introduces the examples of using the Db-type select querytojoin linked list in the zf framework. For more information, see
The sample code of the join () linked list of the zend framework is as follows: <? Php // introduce the Loader class (automatic loading class) require_once ("Zend/Loader. php "); // use the Loader class to introduce a Db class Zend_Loader: loadClass (" Zend_Db "); // introduce the Zend_Db status server Zend_Loader: loadClass (" Zend_Db_Statement_Pdo "); // configure the database connection information $ Config = array ('host' => '127. 0.0.1 ', 'username' => 'root', 'Password' => '000000', 'dbname' => 'test', 'filer' => "true "); // inform Zend_Db of the database and database configuration information operated by the Zend_Db class $ Db = Zend_Db: factory ('pdo _ mysql', $ Config ); // execute the encoding statement $ Db-> quer Y ("set names utf8"); // ----------------------------------------------- $ Select = $ Db-> select (); $ Select-> from ('sanguo ','*'); $ Select-> join ('dengji ', 'sanguo. s_dengji = dengji. d_id'); $ Select-> order ('s _ dengji asc '); $ Reslut = $ Db-> fetchAll ($ Select ); echo "<table border = '1' width = '000000' style = 'text-align: Center'>"; foreach ($ Reslut as $ key => $ value) {echo "<tr>"; foreach ($ value as $ key2 => $ value2) {Echo "<td>". $ value2. "</td>" ;}echo "</tr>" ;}echo "</table>" ;?>