When I try to get the value of "sold" and "featured" I get nothing. What am I doing wrong?
function list_products($sold = false, $featured = false) {
global $link;
$result = mysqli_query($link, "SELECT * FROM products product JOIN images image ON product.id = image.product_id WHERE product.main_image = image.id AND product.sold = $sold AND product.featured = $featured") or die(mysqli_error($link));
}
list_products(false, true);
Edit: If I try to echo $sold or $featured, they are blank. A 1 or 0 should show.