Answer the question
In order to leave comments, you need to log in
Error while outputting strpos() expects parameter 1 to be string, object given?
When outputting values, two errors appear:
Message: strpos() expects parameter 1 to be string, object given Filename: database/DB_active_rec.php
explode() expects parameter 2 to be string, object given Filename: database/DB_active_rec.php
class Services extends CI_Model
{
private $table = 'services';
public function __construct()
{
parent::__construct();
}
function get_all(){
return $this->db->get($this->services)->result();
}
function add($title,$description,$price,$img){
$data = array(
'title' => $title,
'img' => $img,
'description' => $description,
'price' => $price
);
$this->db->insert('services',$data);
}
}
$services = $this->services->get_all();
$data['services']= $services;
<?php foreach($services as $service):?>
<?php echo $service->title.'<br/>' ?>
<?php endforeach?>
if (strpos($table, ',') !== FALSE)
{
return $this->_track_aliases(explode(',', $table));
}
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