Location: PHPKode > scripts > zeMySql Simple > zemysql-simple/zemysql.class.php
<?php
#####################################################################
#### @author: zemin - hide@address.com                      #####
#### Class Name: zeMySql Simple Class |    Date: 12.08.2008     #####
#### Version 1.1
#####################################################################

class zeMySql {

    var $affect = NULL;
    var $insert_id = NULL;

    function _error($query){
        return "Mysql Error: ".mysql_error()." Query: ".$query;
    }

    function get_rows($query){
        $mq = @mysql_query($query) or die($this->_error($query));
        while ($read = @mysql_fetch_object($mq)){
            $arr[] = $read;
        }
        return $arr;
    }

    function get_row($query){
        $mq = @mysql_query($query) or die($this->_error($query));
        return @mysql_fetch_object($mq);
    }

    function get_one($query){
        $mq = @mysql_query($query) or die($this->_error($query));
        return @mysql_result($mq,0);
    }

    function query($query){
        $qu = @mysql_query($query) or die($this->_error($query));
        $this->affect = @mysql_affected_rows();
        $this->insert_id = @mysql_insert_id();
    }

    function get_count($query){
        $mq = @mysql_query($query) or die($this->_error($query));
        return @mysql_num_rows($mq);
    }

}
?> 
Return current item: zeMySql Simple