All pastes #962630 Raw Edit

Miscellany

public php v1 · immutable
#962630 ·published 2008-03-29 22:26 UTC
rendered paste body
		function Query($sql, $args='')		{			if($args) {				if(!is_array($args))				{					$args = array($args);				}							if(is_array($args))				{					$sql = $this->ProcessQuery($sql, $args);				}							if(($result = mysql_query($sql, $this->db_obj)) === FALSE)				{					trigger_error("There was an error processing your query:". $this->error);					return FALSE;				}							$data = array();				while($row = mysql_fetch_assoc($result))				{					$data[] = $row;				}							return $data;			} else {				$sql = $this->ProcessQuery($sql);				if(($results = mysql_query($sql)) === FALSE)				{					trigger_error("There was an error processing your query: ". $this->error);					return FALSE;				}							if(mysql_num_rows($results) == 0)				{					return NULL;				}							$data = array();				while($row = mysql_fetch_assoc($results))				{					$data[] = $row;				}							mysql_free_result($results);							return $data;			}		}