I've just started to use joins and this is almost what i want.
SELECT c.alttext, c.worth, c.deny
FROM cards c
LEFT JOIN user_inventory ui ON c.ID = ui.card_id
WHERE ui.card_id IS NULL
AND c.worth =1
AND c.deny =0
ORDER BY rand( )
LIMIT 1
The sql code is supposed to check a user to see what cards their missing and pick a random one.
At the moment it picks up only cards that no one has
I'm not sure where to put the user_inventory.name = 'Desbrina' since where ever i put it it comes up with no results, since none of the cards will have a user i'm not sure how to go about it.
Can someone help me to change it so that its only cards a certain user doesn't have, not all users