Home >Backend Development >PHP Tutorial >Example of using the db class select queryer join linked list of the zf framework (zend framework)_PHP tutorial

Example of using the db class select queryer join linked list of the zf framework (zend framework)_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:35:55819browse

Example of using zend framework's query join() linked list

Copy code The code is as follows:

//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" ; .0.1' ,
'username' => 'root' ,
'password' => '111' ,
'dbname' => 'test',
'profiler' = > "true"
);
//Tell the database and database configuration information operated by the Zend_Db class
$Db = Zend_Db::factory('PDO_Mysql', $Config);
// Execute the encoding statement
$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 "";
foreach ( $Reslut as $key => $value)
{
echo "";
foreach ($value as $key2 => $value2)
{
echo "";
}
echo "";
}
echo "
" . $value2 . "
";
?>




http://www.bkjia.com/PHPjc/741849.html

www.bkjia.com

http: //www.bkjia.com/PHPjc/741849.htmlTechArticlezend framework query join() linked list usage example copy code code is as follows: ?php //Introduce Loader class ( Automatic loading class) require_once("Zend/Loader.php"); //Use the Loader class to introduce a Db class...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn