Codeigniter error using mysql set variable
Hey guy i have a little problem with codeigniter, i dont know how. If you have any solution regarding this then please answer me
SET @weekVideoCount := (SELECT COUNT(*) FROM videos v
);
SELECT @weekVideoCount;
When I execute this query on Sqlyog, the result is shown successfully, but if I call this query on a model like this,
function getWeeklyUserData(){
$query= $this->db->query("SET @weekVideoCount := (SELECT COUNT(*) FROM videos v);
SELECT @weekVideoCount;
");
return $query->result();
}
error spawned
+3
source to share