title: Count rows in mysql with php when have specific string
body: <p>I have a table in my database named <code>visitor_table</code> . Within table i have a column named <code>visitor_affiliate</code>. I want to get the count of the rows when <code>visitor_affiliate = "someurer"</code> .</p>
  
  <p>I want to get the count as number. I already have this code but i don't know how to get the count only for the rows containing the string. I currently get the number of all rows,</p>
  
  <pre><code>$result = mysql_query("SELECT * FROM visitor_table");   
  $num_rows = mysql_num_rows($result);    
  echo "$num_rows Rows\n";
  </code></pre>