Hi all, i would like to ask,
if i have 3 tables in database and i have a search bar in my web page to search staff id to update details.
The staff id being searched in search bar is assume as $search_id = $_POST['searchid'];
The 3 tables in database are:-
1st table - details
details_id, staff_id, staff_name
2nd table - approval
details_id, staff_id, approve_date
3rd table - disapproval
details_id, staff_id, disapproval_date
how can i write all conditions in a single query to perform action below:-
1) select all the data in DETAILS table WHERE the staff_id equal to the $search_id AND order by DETAILS ID in DESC
2) select the approve date from APPROVAL table WHERE the staff_id equal to the $search_id AND order by DETAILS ID in DESC
3) select the disapproval date from DISAPPROVAL table WHERE the staff_id equal to the $search_id AND order by DETAILS ID in DESC
**I only able to write up to:-
SELECT * FROM details WHERE staff_id LIKE '$search_id ORDER BY details_id DESC;
anyone can assist me on combining all these conditions into a single query?**
Thank you so much!!!!