Use queries with MySQL's Date and Time Functions...

SELECT * FROM myTable WHERE MONTH(myTimeStamp) > MONTH(CURDATE())-6 AND YEAR(myTimeStamp) = YEAR(CURDATE())

This query will get all rows where myTimeStamp is the same year, and within 6 past months of the current date. To get a count of these rows, rather than the rows themselves, change the query to:

SELECT COUNT(*) AS 'referringName' FROM myTable WHERE MONTH(myTimeStamp) > MONTH(CURDATE())-6 AND YEAR(myTimeStamp) = YEAR(CURDATE())

The "AS 'referringName'" part is so that when you get your result in PHP, you can use mysql_fetch_assoc and call it by $sql_row['referringName'].