Welcome Guest, Not a member yet? Register   Sign In
Have a problem cant figure out...

Sorry for being a pain and asking but I have tried everything and while Im learning PHP I dont have the knowledge to work out this problem...

If you look at http://www.findajobni.com/browse/accounting/2147483647 you will see numerous errors but its counting the right jobs for that category...

Now the code I am using it working on another site I have done and I just copied across and modified... here is the code in the controller:

$countit = $this->db->query("SELECT * FROM `jobs` WHERE `category` = '".$this->uri->segment(3)."' ORDER BY `id` ASC");
        $count = $countit->num_rows();
        if ($count == "0"){
            $data['pagetitle'] = $this->config->item('sitename')." No Jobs Found";
        } else {
        $config['base_url'] = site_url('browse/'.$this->uri->segment(2).'/'.$this->uri->segment(3).'');
        $config['total_rows'] = $count;
        $config['per_page'] = 10;
        $config['uri_segment'] = 4;
        $config['next_link'] = 'Next >';
        $config['prev_link'] = '<Previous';
        $num = $config['per_page'];
        $offset = $this->uri->segment(4);
        $this->db->where('category', $this->uri->segment(3));
        $data['query']= $this->db->get('jobs', $num, $offset);
        $data['count'] = $count;
        $data['pagetitle'] = $this->config->item('sitename')." : Browsing Jobs";

The initial repeat call is this
foreach($query->result() as $row):

and ends with
<?php endforeach; ?>
And each tag is called as $row->dbcolumn;

Really am stuck... any help reallllllllly appreciated :d


Sorry, figured it out... I was running another query called $query so I just changed that name...

Theme © iAndrew 2016 - Forum software by © MyBB