All pastes #295987 Raw Edit

Mine

public text v1 · immutable
#295987 ·published 2006-12-29 21:52 UTC
rendered paste body
class Movie_engine {

	var $movies = array();
	var $section;
	
	function Movie_engine()
	{
		$this->object =& get_instance();
		$this->object->load->database();
		$this->section = ($this->object->uri->segment(3) != "") ? $this->object->uri->segment(3) : 0;
		
		log_message('debug','Movie Engine Class Initialised via ' . get_class($this->object));
		/* Get each section's movies */
		
		$query = 'SELECT * FROM videos WHERE category LIKE "' . $this->section . '" ORDER BY `id` ASC';
		echo $query;

		$sql = $this->object->db->query($query);
		$sql_result = array();
		foreach ($sql->result_array() as $row)
			array_push($this->movies, $row);
		
		echo "<pre>" . print_r($this->movies, true) . "</pre>";
	}
	
    function get_movies() /* Return an array of movies to place */
    {
		echo "<pre>" . print_r($this->movies, true) . "</pre>";
    	return $this->movies;
    }
}