I have a table in my database named visitor_table
. Within table i have a column named visitor_affiliate
. I want to get the count of the rows when visitor_affiliate = "someurer"
.
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,
$result = mysql_query("SELECT * FROM visitor_table");
$num_rows = mysql_num_rows($result);
echo "$num_rows Rows\n";
mysql_*
functions in new code! They are in the process of being deprecated. – esqew Jan 18 at 14:49PDO
..see this... php.net/pdo . they are safer and more semantic. but this post does not show any kind of research work.. – pjp Jan 18 at 14:54