0
    final public function setMySQL($key, $value)
    {
        $this->mysql[$key] = $value;
    }


    /*-------------------------------Manage Connection-------------------------------------*/

    final public function connect($type)
    {
        global $core, $_CONFIG;
        if(!$this->connected)
        {k 
            $this->connection = $this->mysql[$type]($_CONFIG['mysql']['127.0.0.1'], $_CONFIG['mysql']['test1'], $_CONFIG['mysql']['12345']);

            if($this->connection)
            {
                $mydatabase = $this->mysql['nexus']($_CONFIG['mysql']['nexus'], $this->connection);

                if($mydatabase)
                {
                    $this->connected = true;    
                }
                else
                {
                    $core->systemError('MySQL Engine', 'MySQL could not connect to database');
                }
            }
            else
            {
                $core->systemError('MySQL Engine', 'MySQL could not connect to host');          
            }
        }
    }

    final public function disconnect()
    {
        global $core;
        if($this->connected)
        {
            if($this->mysql['close'])
            {
                $this->connected = false;
            }
            else
            {
                $core->systemError('MySQL Engine', 'MySQL could not disconnect.');
            }
        }
    }

    /*-------------------------------Secure MySQL variables-------------------------------------*/

    final public function secure($var)
    {
        return $this->mysql['escape_string'](stripslashes(htmlspecialchars($var)));
    }

    /*-------------------------------Manage MySQL queries-------------------------------------*/

    final public function query($sql)
    {
        return $this->mysql['query']($sql, $this->connection) or die(mysql_error());
    }

    final public function num_rows($sql)
    {
        return $this->mysql['num_rows']($this->mysql['query']($sql, $this->connection));
    }

    final public function result($sql)
    {
        return $this->mysql['result']($this->mysql['query']($sql, $this->connection), 0);
    }

    final public function free_result($sql)
    {
        return $this->mysql['free_result']($sql);
    }

    final public function fetch_array($sql)
    {
        $query = $this->mysql['query']($sql, $this->connection);

        $data = array();

        while($row = $this->mysql['fetch_array']($query))
        {
            $data[] = $row;
        }

        return $data;
    }

    final public function fetch_assoc($sql)
    {
        return $this->mysql['fetch_assoc']($this->mysql['query']($sql, $this->connection));
    }




}
?>

Edited by Bas_1

3
Contributors
3
Replies
10
Views
1 Year
Discussion Span
Last Post by diafol
0

Somebady please help!

Edited by Bas_1

1

Friendly advice: don't bump your thread after a few minutes. That's a sure-fire way to get ignored.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.