3个框架,想做简单的sql。我有这样的功能,但问题是我输出
"SELECT listings
.* FROM listings
WHERE listings_id
= '1' LIMIT '1'"我不希望在选择 I 之后立即显示第一个列表想要所有的列。
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);
}
最佳答案
SELECTListings.*FROMlistings
与 SELECT*FROMlistings
相同 - 两者都会为您提供该表中的所有列。
关于mysql - Zend 2 sql查询问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25703483/