rpjd Posted May 4, 2011 Share Posted May 4, 2011 If $result contains the result of mysql_query, a select count distinct query, how do I access the count? I've tried $result[0] to no avail and $result only returns the resource #. Quote Link to comment https://forums.phpfreaks.com/topic/235517-accessing-resource/ Share on other sites More sharing options...
Adam Posted May 4, 2011 Share Posted May 4, 2011 You need to use one of the fetch functions (mysql_fetch_array, mysql_fetch_assoc, ...) The resource only contains a reference to the data on the MySQL server. Quote Link to comment https://forums.phpfreaks.com/topic/235517-accessing-resource/#findComment-1210426 Share on other sites More sharing options...
vicodin Posted May 4, 2011 Share Posted May 4, 2011 you need to use: $row = mysql_fetch_array($result); echo $row['Your_Column_name_here']; Quote Link to comment https://forums.phpfreaks.com/topic/235517-accessing-resource/#findComment-1210427 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.