Im trying to get a sum of Bookings.Spots if the Bookings.FK_ID is equal to Trips.ID - Whats wrong with my code? :
I have 2 tables. Table 1: "Trips" with the fields "ID" and "MaxSpots". Table 2: "Bookings" with the fields "FK_ID" and "Spots"
$sumSpots = "SELECT SUM(Spots) FROM Bookings INNER JOIN
Trips ON Bookings.FK_ID = Trips.ID";
$bookedSpots = mysql_query($sumSpots, MYSQL_ASSOC);
FILE: https://wetransfer.com/downloads/7ec0ee4ecf91718f26804f46f84bf00b20170829113434/0682b9
Im having problems pasting a lot of code to look good :)