Hi I want to query by date, the number of rows from a table (called faults) which represents the number of entries sent by a user between two dates. The user input will be, Inputbox 1 (first_date_opened - which might be 2006-03-01 for example) Inputbox 2(second_date_opened - which might be 2006-03-30 for example) When this query is sent to the database I want to be able display the total number of rows (representing entries) that have been inputted between these dates on the same page. I have been trying to follow several tutorials and have become totally lost. My code so far is as follows, <form name = "datequery" action = "faultCountByDate.php" method = "GET"> <p><u>Produce a count on the number of faults received between two given dates</u><br><br> <p>Please enter the first date to query: <input type="text" name="first_date_opened"> <p>Please enter the second date to query: <input type="text" name="second_date_opened"> <input type = "submit" name = "Query" value = "Click to count" </form> <?php $first_date_opened=$_GET['first_date_opened']; $second_date_opened=$_GET['second_date_opened']; $conn = @mysql_connect("","","")or die("sorry - could not connect to mysql"); $rs = @mysql_select_db("",$conn) or die("problem with database"); $result= mysql_query("SELECT COUNT (*) FROM fault WHERE date_opened > '$first_date_opened' AND date_opened < '$second_date_opened'")//Error message here for line 104 (Parse error: parse error, unexpected T_VARIABLE on line 104) $query=$_GET['Query']; $num_rows = mysql_num_rows($result); if ($query=="Click to count") { echo "The number of faults is: "; echo ($row['$num_rows']) . " "; echo "<br><br>"; } ?> Being I've been following several tutorials, I have ended up with a bit from each, I don't think I need the $row variable. Can anybody sort me out with the correct way? Thanks