Answer the question
In order to leave comments, you need to log in
How can I fix this error A PHP Error was encountered Severity: 8192?
Hello everyone, I'm studying here and at the rate I'm creating a site for watching movies, so my created site worked fine
, but I had to reinstall the system and then it gives this error, although I didn’t make any changes in the code, I copied the project from xampp before installation and after reinstalling put the project back and when you open the site, first there is an error, and then the site itself,
here is the error itself
A PHP Error was encountered
Severity: 8192
Message: Required parameter $limit follows optional parameter $slug
Filename: models/Films_model.php
Line Number: 9
Backtrace:
File: C:\xampp\htdocs\movieworld\application\core\MY_Controller.php
Line: 13
Function: model
File: C:\xampp\htdocs\movieworld\application\controllers\Main.php
Line: 8
Function: __construct
File: C:\xampp\htdocs\movieworld\index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Required parameter $limit follows optional parameter $slug
Filename: models/Serials_model.php
Line Number: 9
Backtrace:
File: C:\xampp\htdocs\movieworld\application\controllers\Main.php
Line: 18
Function: model
File: C:\xampp\htdocs\movieworld\index.php
Line: 315
Function: require_once
<?php
class Films_model extends CI_Model {
public function __construct() {
$this->load->database();
}
public function getFilms($slug = FALSE, $limit, $type = 1) {
if($slug === FALSE) {
$query = $this->db
->where('category_id', $type)
->order_by('year', 'desc')
->limit($limit)
->get('movie');
return $query->result_array();
}
$query = $this->db->get_where('movie', array('slug'=>$slug));
return $query->row_array();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question