I'm trying to generate a list of dates each one being 7 days on from the last,I then hope to query a database to check if this date has been reserved. at the moment I'm trying just to get the basic list weh I use $query='select adddate('2006-02-01',interval 7 day)'; $result=mysql_query($query); echo mysql_result($result,0); I get the expected result I tried putting it in a for loop as below for($counter=1;$counter<28;$counter+=7) { $query='select adddate('2006-02-01',interval $counter day)'; $result=mysql_query($query); echo mysql_result($result,0); } but i get Parse error: parse error, unexpected T_LNUMBER in /home/knott/domains/knottcottage.co.uk/public_html/avail.php on line 17 my complete code is below <html> <head> <title>Availabilty Checker</title> </head> <body> <h1> Availabilty checker </h1> <?php $dbhost = 'localhost'; $dbuser = 'knott_book'; $dbpass = '1234'; $database = 'knott_booking'; echo 'test1'; mysql_connect(localhost,$dbuser,$dbpass); @mysql_select_db($database) or die( "Unable to select database"); for($counter=1;$counter<28;$counter+=7) { $query='select adddate('2006-02-01',interval $counter day)'; $result=mysql_query($query); echo mysql_result($result,0); } ?> </body> </html> Thanks for reading Martin