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 #. 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. 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']; Link to comment https://forums.phpfreaks.com/topic/235517-accessing-resource/#findComment-1210427 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.