Dugong98
Dugong98

Reputation: 791

Selecting only one row for variable that isn't unique

I want to select only one row with the Id 'productId', I am now displaying all three rows with 'productId' of 3, how can I only display 1 row?

enter image description here

      $sql = "SELECT * from Product
      inner join OrderItems ON Product.productId = OrderItems.productId";

Any help would be greatly appreciated

Upvotes: 0

Views: 33

Answers (1)

Dugong98
Dugong98

Reputation: 791

With the nudge from Joe, this works!

$sql = "SELECT * from Product
inner join OrderItems ON Product.productId = OrderItems.productId where Product.size = OrderItems.size and Product.color = OrderItems.colors";

Upvotes: 1

Related Questions