techker Posted September 1, 2009 Share Posted September 1, 2009 Hey guys!! i have a quick question.i have a database that holds clients info name..number..payment method.. i need to count how many clients payed by visa so the tables name is new_members the row is called mode i got up to here but it always shows 0 SELECT COUNT( `mode` ) AS TotalNumber, SUM( `mode` ) AS TotalPrice FROM `new_members` WHERE `mode`= CHEQUE <?php echo $row3['TotalPrice'] ?> [code] i used a query from another page in my script.. Link to comment https://forums.phpfreaks.com/topic/172632-solved-count-query/ Share on other sites More sharing options...
ReKoNiZe Posted September 1, 2009 Share Posted September 1, 2009 SELECT COUNT(*) As TotalNumber FROM new_members WHERE mode="visa" That will list a TotalNumber of the times visa was used. Link to comment https://forums.phpfreaks.com/topic/172632-solved-count-query/#findComment-910053 Share on other sites More sharing options...
techker Posted September 1, 2009 Author Share Posted September 1, 2009 nice...i should of looked at select count...lol Link to comment https://forums.phpfreaks.com/topic/172632-solved-count-query/#findComment-910239 Share on other sites More sharing options...
techker Posted September 2, 2009 Author Share Posted September 2, 2009 is there a way to make it stay?cause the next day it disappears since it is only set to current day.. Link to comment https://forums.phpfreaks.com/topic/172632-solved-count-query/#findComment-910866 Share on other sites More sharing options...
techker Posted September 2, 2009 Author Share Posted September 2, 2009 anybody? Link to comment https://forums.phpfreaks.com/topic/172632-solved-count-query/#findComment-911229 Share on other sites More sharing options...
fenway Posted September 7, 2009 Share Posted September 7, 2009 is there a way to make it stay?cause the next day it disappears since it is only set to current day.. What is set to the current day? Link to comment https://forums.phpfreaks.com/topic/172632-solved-count-query/#findComment-914146 Share on other sites More sharing options...
techker Posted September 7, 2009 Author Share Posted September 7, 2009 i figured out that the field was set to varchar not date.. Link to comment https://forums.phpfreaks.com/topic/172632-solved-count-query/#findComment-914151 Share on other sites More sharing options...
fenway Posted September 8, 2009 Share Posted September 8, 2009 So, solved? Link to comment https://forums.phpfreaks.com/topic/172632-solved-count-query/#findComment-915036 Share on other sites More sharing options...
techker Posted September 8, 2009 Author Share Posted September 8, 2009 ya thx! Link to comment https://forums.phpfreaks.com/topic/172632-solved-count-query/#findComment-915057 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.