Welcome Guest, Not a member yet? Register   Sign In
Problem using ActiveRecord Class from Wiki
#1

[eluser]mambe churchill nanje[/eluser]
Hello can someone help me out here with this ActiveRecord
http://codeigniter.com/wiki/ActiveRecord_Class/ class usage,

here is a link to a site am working on, a simple cms I built has this news section

http://www.mpyraa.org/en/cms/newscontroller/

the page works well in localhost but on the server like you must have observed it says
Quote:A Database Error Occurred

Error Number: 1054

Unknown column 'news.*' in 'field list'

SELECT `news`.`*` FROM (`news`) ORDER BY `id` desc LIMIT 6

The code that runs the controller is as follow:

Code:
<?php
/**
* Generic News controller for all afrovisiongroup.com 50k sites that need news implementation
* AfroVisioN News class
*
* @package        CodeIgniter
* @subpackage    Controllers
* @category    Controllers
* @author        Mambe Churchill
* @version        1.0
*/

class newscontroller extends Controller{
    //contstructor
    function newscontroller(){
        parent::Controller();
        $news = & $this->load->model('news');
        $this->load->helper(array('text','typography'));
    }
    //the news index function
    function index(){
        $this->showArticles();
    }
    //show articles function that shows all the articles
    function showArticles($offset=0){
        $this->load->library('pagination');
        $perpage=6;
        $data['offset']=$offset;
        $data['perpage']=$perpage;
        $data['articles']=$this->news->ordering('id','desc')->find_and_limit_by($perpage,$offset);
        $this->load->view('news/home_tpl',$data);
    }
    //create a function that shows a single article
    function showArticle($id,$seo=""){
        $data['article']=$this->news->find($id);
        $this->load->view('news/article_tpl',$data);
    }
}
?>


can someone tell me why this
Code:
$this->news->ordering('id','desc')->find_and_limit_by($perpage,$offset);
works on my localhost and not on the server though both are running php 5 ??


Messages In This Thread
Problem using ActiveRecord Class from Wiki - by El Forum - 02-11-2009, 02:42 AM
Problem using ActiveRecord Class from Wiki - by El Forum - 02-11-2009, 03:22 AM
Problem using ActiveRecord Class from Wiki - by El Forum - 02-11-2009, 03:51 AM
Problem using ActiveRecord Class from Wiki - by El Forum - 02-11-2009, 04:00 AM
Problem using ActiveRecord Class from Wiki - by El Forum - 02-11-2009, 04:48 AM
Problem using ActiveRecord Class from Wiki - by El Forum - 02-11-2009, 05:16 AM
Problem using ActiveRecord Class from Wiki - by El Forum - 02-11-2009, 02:21 PM
Problem using ActiveRecord Class from Wiki - by El Forum - 02-11-2009, 02:29 PM
Problem using ActiveRecord Class from Wiki - by El Forum - 02-11-2009, 02:33 PM
Problem using ActiveRecord Class from Wiki - by El Forum - 02-12-2009, 01:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB