I have a problem now
join store product
product store_id
product
store_id
check box is store_id
, but I found that even if it is the same store_id, it will print out
. What I want to achieve is that just show a store_id, and as long as the same store_id is arranged in the same way, unless it is a different store_id
, can you give me an idea?
$data = $pdo->query(
"SELECT
p.url AS url,
p.name AS pname,
p.icon AS icon,
p.price AS price,
p.original_price AS original_price,
p.prod_id AS prod_id,
p.views AS views,
s.name AS sname,
s.delivery_price AS delivery_price,
s.store_id AS store_id,
c.cart_id AS cart_id,
c.quan AS quan FROM `user_cart` as c
JOIN
`product` as p ON c.prod_id = p.prod_id
JOIN
`store` as s ON s.store_id = p.store_id
WHERE
c.id = "{$_SESSION["user-id"]}"
AND
p.delivery_from = "store" "
);