I'm trying to develop a management system as a part of my thesis.
Question: What is wrong with the following query?
$query = "SELECT ab.bloodtype, dep.date_donated, dep.amount, sr.
first_name, sr.last_name, loc.location_name
FROM deposits AS dep
INNER JOIN donorstb AS sr ON dep.donor_id = sr.donorID
INNER JOIN available_blood AS ab ON dep.blood_id = ab.blood_id
INNER JOIN location AS loc ON dep.location_id = loc.location_id
ORDER BY donorID DESC;"
The desired output is something like the following:
Firstname | Lastname | Date Donated | Donated at | Bloodtype | Amount
Ron | Flores | November 18,2017 | Vigan | B+ | 2units
You need to share those tables. Whatever I just edit your code. Try It -