Home >php教程 >php手册 >zf框架的db类select查询器join链表使用示例

zf框架的db类select查询器join链表使用示例

WBOY
WBOYOriginal
2016-06-13 09:40:45877browse

 这篇文章主要介绍了zf框架的Db类select查询器join链表使用示例,需要的朋友可以参考下

zend框架的查询器join()链表使用示例    代码如下: '127.0.0.1' ,     'username' => 'root' ,      'password' => '111' ,      'dbname' => 'test',     'profiler' => "true"     ); //告诉Zend_Db类所操作的数据库和数据库配置信息 $Db = Zend_Db::factory('PDO_Mysql' , $Config);  //执行编码语句  $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 . "
"; ?>  
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