unemployment Posted April 10, 2011 Share Posted April 10, 2011 How do I find the count of mysql num rows and output that value with this function? function fetch_company_fans($cid) { $cid = (int)$cid; $sql = "stuff"; $result = mysql_query($sql); $fans = array(); while (($row = mysql_fetch_assoc($result)) !== false) { $fans[] = array( 'username' => $row['username'], ); } return $fans; } Link to comment https://forums.phpfreaks.com/topic/233270-include-mysql-numrows/ Share on other sites More sharing options...
dcro2 Posted April 10, 2011 Share Posted April 10, 2011 $result = mysql_query($sql); if($result) echo "Rows found: ".mysql_num_rows($result); Link to comment https://forums.phpfreaks.com/topic/233270-include-mysql-numrows/#findComment-1199746 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.