If the classification is the same, then there is no need to show the same classification again?

I have a problem now

clipboard.png

join store product
product store_id
product
store_id

clipboard.png

The

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" "
    );
Mar.28,2021

description is not very clear, but take a look at your sql does not exist in the mysql de-duplicate distinct or group by operation, if you do not know these two methods, you can understand. This should satisfy what you said, different store_id.
of course, you may have other needs, so you may need to describe it more clearly so that people can give you effective advice.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-7ad2a5-2cd75.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-7ad2a5-2cd75.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?