public function s2o($sql, $params=null, $class_name='')
    {


        //if it has parameters then prepare the statement and execute with the parameters
        //stmts that have already been prepared will reuse the prepared statement
        if(is_array($params) || is_object($params)){

            //convert object parameters
            $param = is_array($params) ? $params : self::paramify($params);

            $stmt = $this->prepare($sql);
            $result = $stmt->execute($params);

            if(!$result){
                return Array();
            }

        //if there
        } else {

            $result = $this->query($sql);
            if(!is_object($result)){
                return Array();
            } else {
                $stmt = $result;
            }

        }

        //if the class_name is set return instances
        if(!preg_match("~^SELECT|EXEC|CALL~i", trim($sql))){
            return $stmt;
        } elseif(!empty($class_name)){
            if(class_exists($class_name)){
                return $stmt->fetchAll(\PDO::FETCH_CLASS, $class_name);
            }
        } else {
            //otherwise return standard objects
            return $stmt->fetchAll(\PDO::FETCH_OBJ);
        }

    }