I am creating small e shop for selling products in it, but I cannot figure out How I need to sort. So I need to sort items in terms of brands, price range, gender (for man or woman). If user gives me all three details, I just do it in 3 where statement, like this:
$this->db->where('brands', $brand_name);
$this->db->where('price', $price);
$this->db->where('gender', $gen);
But what if user just gives me just 2 categories, will empty where statement make problem? and if user gives me multiple brand names, how can I write multiple where statements for sorting?
Thank you
Aucun commentaire:
Enregistrer un commentaire