toxicityj Posted November 16, 2010 Share Posted November 16, 2010 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 More sharing options...
[dx] Posted November 17, 2010 Share Posted November 17, 2010 Try again use other name of column. Something like Years, etc. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.