Home > Backend Development > PHP Tutorial > yii 查询问题

yii 查询问题

WBOY
Release: 2016-06-23 13:01:29
Original
753 people have browsed it

  $connection = Yii::app()->db;        $table = $connection->tablePrefix.'insurance';        $sql = "select insurance_id, insurance_urlname from $table where insurance_display='Y' and insurance_status='A'";        $command = $connection->createCommand($sql);        $list = $command->execute();
Copy after login


$list  返回的是查询出来的条数

如何返回查询出来的结果集?


回复讨论(解决方案)

execute (执行)
只用于无返回结果的场合

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template