I am making a food donating application. I have three tables in the database namely:
user_info
donated_info
accepted_info
The attributes of 'user_info' table are:
user_id, name, username, password, address, phone, pincode
The attributes of 'donated_info' table are:
user_id, Food_id, Food_item, No_of_serving, Expiry_date, Expiry_time, Image, status
The attributes of 'accepted_info' table are:
Food_id, user_id
I want to create a module in which the donater gets to view the status of his donations. [By default, the status attribute is set to 'to_accept'. Whenever someone accepts it, the value is changed to 'accepted'. I want to retrieve four columns: name, phone, Food_item, Image. If the Food_item is accepted, the name and phone number of the person who has accepted it will be displayed. Else those two columns will be empty. How can I write a query for this? Any kind of helps will be greatly appreciated.