Jump to content

SUM() outputting just -5


toxicityj

Recommended Posts

Update- Nevermind! Figured out the issue that I needed to put $year_select in quotes because the column name was 1950-1955 and it was treating that as a math problem instead of as a column name. Fixed that and it resulted in just outputting '1950'.I've got a database full of lovely numbers in a column that I'm trying to add up. I'm still new to PHP/SQL so I spend half the day googling for that solution. Well for some reason it just keeps outputting -5 and the sum no matter what the numbers are that it's given.I'm pretty sure my code is correct, because I got it to add up a separate column properly.

SELECT SUM($year_select) AS Totals FROM agglomeration_growth_rate WHERE Country = $region_select

Any ideas?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...