protected function _fromDualIfy($queryString)
    {
        $statement = strtolower(trim($queryString));
        if (strpos($statement, 'select') !== 0 || preg_match('/ from /', $statement)) {
            return $queryString;
        }
        //Doing a SELECT without a FROM (e.g. "SELECT 1 + 1") does not work in Oracle:
        //need to have "FROM DUAL" at the end
        return "{$queryString} FROM DUAL";
    }
protected function _fromDualIfy($queryString)
    {
        $statement = strtolower(trim($queryString));
        if (strpos($statement, 'select') !== 0 || preg_match('/ from /', $statement)) {
            return $queryString;
        }
        //Doing a SELECT without a FROM (e.g. "SELECT 1 + 1") does not work in Oracle:
        //need to have "FROM DUAL" at the end
        return "{$queryString} FROM DUAL";
    }
protected function _fromDualIfy ( $ queryString ) { $ statement = strtolower ( trim ( $ queryString ) ) ; if ( strpos ( $ statement , 'select' ) !== 0 || preg_match ( '/ from /' , $ statement ) ) { return $ queryString ; } //Doing a SELECT without a FROM (e.g. "SELECT 1 + 1") does not work in Oracle: //need to have "FROM DUAL" at the end return "{$queryString} FROM DUAL" ; }
Add "FROM DUAL" to SQL statements that are SELECT statements
with no FROM clause specified

@param string $queryString query
@return string
Add FROM DUAL to SQL statements that are SELECT statements with no FROM clause specified