I’m a newbie and developing php laundry service.
im using SESSION for the login,
Im having trouble when a username add a laundry ticket 2 times, so it will create 2 ticket_id, for example, 1001 and 1002 in table TICKET. they are both different order, under same username.
so when I want to display for example, ticket_id,
SELECT ticket_id FROM TICKET WHERE ticket_username=$username
problem is it will show both of ticket id 1001 and 1002 since they are from same username.
im stuck help me
At some point you would want to be able to retrieve all orders by a customer or do you not want a user to be able to create 2 orders at the same time?
Anyway, if you only want the first order just use
SELECT ticket_id FROM TICKET WHERE ticket_username=$username LIMIT 1;
But I think you need to be clear about whether two orders can be created and how you’re going to prevent if if they can’t.
Answered By – Steve