PHP100.COM原创技术文章.Zend Framework 数据库操作总结
作者:memory 发布时间:2010-05-08, 22:26:31 分类:WEB程序开发 阅读:2187
Zend_Db数据库知识
例子:
Model文件:
$this-〉fetchAll("is_jian=1","id DESC",0,2)-〉toArray();//根据is_jian=1,按id倒序排列取前2条记录当第一个参数为null时,则直接按id倒序排列ASC为正序。
路由文件:
$video=new Video();//实例化数据库类
$this-〉view-〉get2Video =$video-〉get2Video();//取到2条首页推荐的数据
index.phtml文件:
〈?php foreach ($this-〉get2Video as $
例子:
Model文件:
$this-〉fetchAll("is_jian=1","id DESC",0,2)-〉toArray();//根据is_jian=1,按id倒序排列取前2条记录当第一个参数为null时,则直接按id倒序排列ASC为正序。
路由文件:
$video=new Video();//实例化数据库类
$this-〉view-〉get2Video =$video-〉get2Video();//取到2条首页推荐的数据
index.phtml文件:
〈?php foreach ($this-〉get2Video as $



