That's not an SQL problem. Parse errors are generated by PHP.
I thought at first that ''1968-09-01'' were double quotes until I copied them. They're single quotes. So, you must escape them with a backslash.
Change this part:
$dateQuery = 'set @targetdate=''1968-09-01''; '
To this:
$dateQuery = 'set @targetdate=\'1968-09-01\'; '
or you can do it using double quotes like so:
$dateQuery = "set @targetdate='1968-09-01'; "
It's not recommend to nest SQL like that in PHP because if you get an error you won't know which SQL gave the error.
What type of database server are you using?
FYI:
Parse Errors are caused by human error. Check on the line of the error, but usually one to many lines before it, for missing closing tags (i.e. ", ), }, ;, etc.).
Here's a list of what those PHP tokens seen in error messages mean:
http://us2.php.net/manual/en/tokens.php#tokens
hth.
Edit: Posted too late.