I have the following query, in the products table (tbl_products) I am linked by the store id (id_store), what I need is to count how many published products the store has in the table (tbl_products), I tried the following but it does not count .
$stmt = $con->prepare("SELECT st.id_store,
st.photo,
st.store,
st.address,
st.phone,
st.email,
st.in_offer,
st.url,
COUNT(p.id_product) //p.id_store
FROM tbl_store st
LEFT JOIN tbl_products p ON st.id_store = p.id_store
WHERE st.id_user=?");
$stmt->bind_param("i",$id_user);
$stmt->execute();
$stmt->bind_result(
$st_id_store,
$st_photo,
$st_store,
$st_address,
$st_phone,
$st_email,
$st_in_offer,
$st_url
);
$stmt->fetch();