All pastes #194147 Raw Edit

K\sd

public php v1 · immutable
·published 2006-10-07 16:14 UTC
rendered paste body
<?php/* OOP for links module** Problem: $object = new links;* Descript: calling script seems to die during the call. Prevents any printout or function calls to*			the remaining of the calling script while not returning a error. */class LinkDump	{	var $result;	var $query;	var $limit;	var $error;		function set ($what,$value) {		$this->$what="$value";	}	function field ($what) {		return($this->$what);	}	function linkdump () {		$this->error="";		$this->limit="0";	}	function get ($which = 0,$limit = 0) {		if (!$which)			$this->query = "SELECT * FROM `links`";		else			$this->query = "SELECT * FROM `links` WHERE `id` = $which";		if ($limit)			$this->query .= " LIMIT $limit";		echo "gote: ".$this->query;		$mysql = mysql_query($this->query) or $this->error = mysql_error();				if ($this->error) return $this->error;		while ($row = mysql_fetch_assoc($mysql))		{			$this->result[] = $row; //add row to array for later return		}		return $this->result; // return array to be cycled for caller	}}?>