techker Posted August 24, 2010 Share Posted August 24, 2010 Hey guys in my database i have a colum Retail_price in it the numbers are seperated by, so :9,245$ so my query $q4 ="SELECT sum( Retail_price ) AS TotalCount FROM cars"; $res4 = mysql_query($q4); $row4 = mysql_fetch_assoc($res4) works but only counts the nember before , ....?? Link to comment https://forums.phpfreaks.com/topic/211630-sum-question/ Share on other sites More sharing options...
kickstart Posted August 24, 2010 Share Posted August 24, 2010 Hi Is Retail_price a numeric column, or just a character column that contains the price? All the best Keith Link to comment https://forums.phpfreaks.com/topic/211630-sum-question/#findComment-1103254 Share on other sites More sharing options...
techker Posted August 24, 2010 Author Share Posted August 24, 2010 i have it as varchar.. if i change it will i loose what i have in there? Link to comment https://forums.phpfreaks.com/topic/211630-sum-question/#findComment-1103268 Share on other sites More sharing options...
kickstart Posted August 24, 2010 Share Posted August 24, 2010 Hi I wouldn't trust it not to lose it. Short term add an extra column (say Retail_price_Numeric) and set that to equal the numeric value of Retail_price. All the best Keith Link to comment https://forums.phpfreaks.com/topic/211630-sum-question/#findComment-1103331 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.