0
3框架並想做簡單的sql。我有這樣的功能,但問題是,我輸出 「SELECT listings
。* FROM listings
WHERE listings_id
='1'LIMIT'1'」我不想在第一個列表後選擇我想要所有的列。Zend 2 sql查詢問題
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);
}