Mysql Zend 2 sql查询问题
3框架,想做简单的sql。我有这样的函数,但问题是我输出 选择列表。*从列表中,列表_id='1'限制'1'我不想要在选择后的第一个列表,我想要所有列Mysql Zend 2 sql查询问题,mysql,sql,database,zend-framework,pdo,Mysql,Sql,Database,Zend Framework,Pdo,3框架,想做简单的sql。我有这样的函数,但问题是我输出 选择列表。*从列表中,列表_id='1'限制'1'我不想要在选择后的第一个列表,我想要所有列 static $tableName = 'listings'; public function getListingsById($id){ $select = new Select(); $select->from(self::$tableName); $where = new Where(); $whe
static $tableName = 'listings';
public function getListingsById($id){
$select = new Select();
$select->from(self::$tableName);
$where = new Where();
$where->equalTo('listings_id', $id);
$select->where($where);
$select->limit(1);
echo $select->getSqlString($this->getAdapter()->getPlatform());
return $this->selectWith($select);
}
SELECT listings.*FROM listings与SELECT*FROM listings相同-两者都将提供该表中的所有列