How to implement join? Did you enjoy it? There is nothing to say about it!

my merchandise table product

clipboard.png

user_cart

clipboard.png






https://imgur.com/a/BrEOuNt


clipboard.png

but it just doesn"t show up.

<? while($row = mysqli_fetch_array($data)){?>
        <?=$row["name"];?>
      <?}?>

is there a wrong code shown?

Mar.22,2021

has a rough idea of your needs. You need to get specific information about the goods through the information in the shopping cart, right? Finally, the user's information is displayed. So if that's right, it should be the information display design in the background. The sql statement you added later is correct, even if I rewrite it, the shopping cart is associated with the goods, and the shopping cart is then associated with the user. With regard to the fact that you say that there is no data, then can you confirm whether the data in your database already match or not?


clipboard.png
did you add conditions to this code


user_cart idid,
select uc.* from user_cart as uc 
left join product as p on uc.prod_id = p.prod_id
where uc.id = '{$_SESSION["user-id"]}'

Menu