MySQL::QuerySingleRow PHP Method

QuerySingleRow() public method

Executes the given SQL query and returns only one (the first) row
public QuerySingleRow ( string $sql ) : object
$sql string The query string should not end with a semicolon
return object PHP resource object containing the first row or FALSE if no row is returned from the query
    public function QuerySingleRow($sql)
    {
        $this->Query($sql);
        if ($this->RowCount() > 0) {
            return $this->Row();
        } else {
            return false;
        }
    }

Usage Example

Example #1
0
 function getLayeredFilter()
 {
     $sql = "SELECT filters FROM ps_layered_filter WHERE name = 'VisionFilter'";
     $db = new MySQL();
     return $db->QuerySingleRow($sql);
 }
All Usage Examples Of MySQL::QuerySingleRow