I have mysql query and it seems to work but doesn't return values from payments table.
What am I doing wrong?

```
SELECT members.id, members.name, members.lastname 
FROM members 
JOIN (SELECT payments.id, payments.user_id,  payments.begin_date,
MAX(payments.finish_date) AS finish_date, payments.price 
FROM payments 
GROUP BY payments.user_id) 
AS payments 
WHERE members.id=payments.user_id AND payments.finish_date>=CURDATE() 
ORDER BY payments.finish_date ASC, payments.id ASC`

```

and I use:

```
echo stripslashes($wiersz['begin_date']);

```

to return row data.