<?php
class db
{
    private $count;

    public function connect()
    {
            mysql_connect(DB_HOST, DB_USER, DB_PASS);
            mysql_select_db(DB_NAME);
    }

    public function query($query)
    {
            $this->count++;
            return mysql_query($query);
    }

    public function fetch_array($result)
    {
            return mysql_fetch_array($result, MYSQL_ASSOC);
}

    public function num_rows($result)
    {
            return mysql_num_rows($result);
    }

    public function get_count()
    {
            return $this->count;
    }
}