<?
class query{
	var $result; var $data;
	function queryMultiSelect($qry){
		$i=0;
		$this->data=array();
		$this->result=mysql_query($qry) or die("ERROR: when multi data select=>".mysql_error());			 
		while ($row=mysql_fetch_assoc($this->result)){
			$this->data[$i] = $row;
			$i++;
		}
		mysql_free_result($this->result);
		return $this->data;
	}
			
	function querySelectSingle($qry){
		$this->result=mysql_query($qry) or die("ERROR: when single data select=>".mysql_error());
		$this->data=mysql_fetch_assoc($this->result);
		mysql_free_result($this->result);
		return $this->data;
	}			
			
	function numRows($nr){
		$this->result=mysql_query($nr) or die("ERROR: number row failed=>".mysql_error());
		$this->data=mysql_num_rows($this->result);
		mysql_free_result($this->result);
		return $this->data;
	}
			
	function queryExecute($qd){
		$execute=mysql_query($qd) or die("ERROR: When query execute=>".mysql_error());
		return $execute;
	}			
}
$qry=new query;
?>