system: Linux mars.sprixweb.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
cmd: 

Direktori : /home/pfhr/public_html/Bin/
Upload File :
Current File : /home/pfhr/public_html/Bin/Query.php

<?php
/**
 * Querying
 *
 * This class contains functions to process the 
 * query and give the outputs
 * 
 *
 * @package		Bin
 * @category	Core
 * @author		AOA Development Team
 * @link		http://AOA.ajsquare.com
 * @version 	1.0
 */

// ------------------------------------------------------------------------  
class Bin_Query extends Bin_DbConnect 
{
	
	var $totrows;
	var $records;
	var $insertid;
	var $sql;
	
	
	/**
	 * Enter description here...
	 *
	 * @param string $sql
	 * @param array $fields
	 * @return boolean
	 */
	function executeQuery($sql)
	{
		
		$i=0;
		$rs = mysql_query($sql); 		
		$this->insertid = mysql_insert_id();
		
		if(!mysql_affected_rows() || mysql_num_rows($rs) < 1)
			return false;
		else
		{
			$this->totrows = mysql_num_rows($rs);
			while($fetch = mysql_fetch_array($rs))
			{
				$this->records[$i] = $fetch;
				$i++;
			}
			for($i=0;$i<count($this->records);$i++)
			{
				foreach ($this->records[$i] as $key=>$item)
				{
					if(is_numeric($key))
						unset($this->records[$i][$key]);
				}
			}
			return true;
		}
	}

	/**
	 * @param string $sql
	 * @return boolean
	 */
	function updateQuery($sql)
	{
		$rs = mysql_query($sql); 
		$sql = $sql;
		$this->insertid = mysql_insert_id();
		if(!$rs)
			return false;
		else
			return true;
	}	
}
?>