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 Quote Link to comment 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']; Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.