I want to use a parameter in the following query, but I am not really sure how to.
If you can help me, I will be greatful.
$id will be 1, 2 or 3 etc. and I want to select where C.Name is Galleri1, or Galleri2 etc.
This is what I got so far, but I am not sure how to add $id.
function getGallery($id){
$data = array();
$Q = $this->db->query('SELECT P.*, C.Name AS CatName
FROM products AS P
LEFT JOIN categories C
ON C.id = P.category_id
WHERE C.Name = "Galleri($id)"
AND p.status = "active"
');
UPDATE: I am using PHP and MySQL