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 "
" . print_r($this->movies, true) . "
"; } function get_movies() /* Return an array of movies to place */ { echo "
" . print_r($this->movies, true) . "
"; return $this->movies; } }