adam87 Posted March 26, 2009 Share Posted March 26, 2009 Basically I'm trying to find a way of counting and displaying how man rows that contain firefox in them and give me an output of how many. $result = mysql_query ("SELECT count('firefox') FROM browser"); echo $result; I have tried a few different ways but this was the last one I gave ago, the output it gives with this code is "Resource id #3". Hope I explained that OK =S Link to comment https://forums.phpfreaks.com/topic/151160-count-function/ Share on other sites More sharing options...
Maq Posted March 26, 2009 Share Posted March 26, 2009 Try: $result = mysql_query ("SELECT count(firefox) AS num FROM browser") or die(mysql_error()); $row = mysql_fetch_assoc($result); echo $row['num']; Link to comment https://forums.phpfreaks.com/topic/151160-count-function/#findComment-794099 Share on other sites More sharing options...
taquitosensei Posted March 26, 2009 Share Posted March 26, 2009 You're missing a step check out http://www.tizag.com/mysqlTutorial/mysqlquery.php This should help Link to comment https://forums.phpfreaks.com/topic/151160-count-function/#findComment-794100 Share on other sites More sharing options...
adam87 Posted March 26, 2009 Author Share Posted March 26, 2009 Thanks guys, got it working by using the link you gave me taquitosensei, thanks for your help =D Link to comment https://forums.phpfreaks.com/topic/151160-count-function/#findComment-794110 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.