I have a query that i execute within zend framework 2
protected function getCityByZip($zip){
$adapter = $this->getServiceLocator()->get('myConn');
$sql = new Sql($adapter);
$select = $sql->select();
$select->from(array("cities" => "cities"))
->columns(array('cityName'))
->where(array("cityZip" => $zip));
$statement = $sql->prepareStatementForSqlObject($select);
$result = $statement->execute();
return $result;
}
i want to do something like
executeScalar();
and get just a single value, and not a result set like i get here from using execute()
how is this possible?