There are tables:

invites id name icode 1 Kex 900 2 Anton 343 3 Georg 922 list id status offerid 1 accept 900 2 accept 343 3 send 922 4 denied 900 5 denied 900 6 send 900 7 send 900

There is a redbean request:

 $query = R::getAll("SELECT * FROM invites, list WHERE invites.icode = list.offerid AND invites.name = 'Kex'"); foreach($query as $row){ echo $row['status']; } 

It seems everything is normally displayed in a loop, but the first 3 lines are repeated 3 times, that is, instead of

 accept denied send send 

it is displayed

 accept denied send accept denied send accept denied send send 

and then everything goes fine in the database I tried to output it like this:

 SELECT l.id, l.status FROM `list` l LEFT JOIN invites i ON i.icode = l.offerid WHERE i.name = 'Kex'; 

but only the repeat order changes from 1 2 3 1 2 3 1 2 3 to 1 1 1 2 2 2 3 3 3

    1 answer 1

    Need to use Distinct, thanks @bask from the Toaster.