Welcome Guest, Not a member yet? Register   Sign In
controllers/News.php
#12

(04-29-2019, 08:08 AM)ciadmin Wrote: You deleted the vurly brace at the end of the index method, before line 18.
You need to proof-read your code before jumping to the conclusion that CI is broken.

<<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class News_model extends CI_Model {

public function __construct()
{
$this->load->database();

}
}

public function get_news($slug = FALSE)
{
if ($slug === FALSE)
{
$query = $this->db->get('news');
return $query->result_array();

}

$query = $this->db->get_where('news', array('slug' => $slug));
return $query->row_array();

}

Do you mean the line which I high lighten in bold.

Remember I am new to code igniter.
Reply


Messages In This Thread
controllers/News.php - by shewolf255 - 04-29-2019, 12:01 AM
RE: controllers/News.php - by ciadmin - 04-29-2019, 01:39 AM
RE: controllers/News.php - by shewolf255 - 04-29-2019, 06:21 AM
RE: controllers/News.php - by ciadmin - 04-29-2019, 06:26 AM
RE: controllers/News.php - by shewolf255 - 04-29-2019, 07:01 AM
RE: controllers/News.php - by albertleao - 04-29-2019, 07:13 AM
RE: controllers/News.php - by shewolf255 - 04-29-2019, 07:57 AM
RE: controllers/News.php - by shewolf255 - 04-29-2019, 07:48 AM
RE: controllers/News.php - by Wouter60 - 04-29-2019, 07:59 AM
RE: controllers/News.php - by ciadmin - 04-29-2019, 08:08 AM
RE: controllers/News.php - by shewolf255 - 04-29-2019, 10:45 AM
RE: controllers/News.php - by shewolf255 - 04-29-2019, 10:48 AM
RE: controllers/News.php - by Wouter60 - 04-29-2019, 08:52 AM
RE: controllers/News.php - by shewolf255 - 04-29-2019, 11:02 AM
RE: controllers/News.php - by ciadmin - 04-29-2019, 11:06 AM
RE: controllers/News.php - by shewolf255 - 04-29-2019, 02:02 PM
RE: controllers/News.php - by InsiteFX - 04-29-2019, 04:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB