这是我的截图问题
我认为我有以下代码。
$jumlah = $this->db->query("
SELECT * FROM actor
JOIN film_actor ON film_actor.actor_id=actor.actor_id
JOIN film ON film.film_id=film_actor.film_id
JOIN film_category ON film_category.film_id=film.film_id
JOIN category ON category.category_id=film_category.category_id
WHERE first_name like $u->first_name AND last_name like $u->last_name");
?>
为什么我的查询不起作用?我想我已经完成了该代码,但为什么我收到错误消息。
抱歉,我无法详细描述我的问题,但我有描述的图像。
答案 0 :(得分:0)
$array = array('first_name' => $u->first_name, 'last_name' => $u->last_name);
$jumlah = $this->db->select('*')->from('actor');
$this->db->join('film_actor', 'film_actor.actor_id=actor.actor_id');
$this->db->join('film', 'film.film_id=film_actor.film_id');
$this->db->join('film_category', 'film_category.film_id=film.film_id');
$this->db->join('category', 'category.category_id=film_category.category_id ');
$this->db->like($array); // WHERE `first_name` LIKE '%$u->first_name%' AND `last_name` LIKE '%$u->last_name%'