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; } Quote Link to comment 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); 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.