This article mainly introduces the ZF Framework's DB Class select query Join list Use example, the need for friends can refer to the following
The Zend framework's query join () list uses the example code as follows: <?php//Introduce Loader class (Auto Load Class) require_once ("zend/loader.php"); Use the Loader class to introduce a Db class Zend_loader::loadclass ("zend_db"); Introducing the ZEND_DB state-Zend_loader::loadclass ("Zend_db_statement_pdo"); Configure database connection Information $Config = Array (' Host ' => ' 127.0.0.1 ', ' username ' => ' root ', ' Passwo Rd ' => ', ' dbname ' => ' test ', ' Profiler ' => ' true ' ; Tells the database and database configuration information that the zend_db class operates $Db = Zend_db::factory (' Pdo_mysql ', $Config); //EXECUTE encoded statements $Db-> query ("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= ' style= ' text-align:center ' >"; foreach ($Reslut as $key => $value) { echo "<tr>"; foreach($value as $key 2 => $value 2) { echo "<td>". $value 2. "</td>"; &NBSP} echo "</tr>"; echo "</table>";?>