Display different values in the same data table?

SELECT * FROM `user_cart` as c
        JOIN
          `product` AS b ON c.prod_id = b.prod_id
        WHERE
          c.id = "{$_SESSION["user-id"]}"

I have a value in product called from, which is either an or b
, but what is shown now is that as long as the id matches, it will all be displayed

.
while($row = mysqli_fetch_array($data)){
....
}

but what I want to score now is
if the threshold from value is a, then it is shown in the upper part
if the from is b, it is shown in the lower half?

Mar.24,2021

I find that you have asked such questions many times, but you can find answers to these questions in the documentation. I suggest you take a good look at the documentation first.


query and then group or try group

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-1e4c0a0-59ecf.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-1e4c0a0-59ecf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?