I am creating a search application with a 1) search form, 2) search results list (with links), and 3) a full document display. Once the search criteria is established and a specific document has been selected from the list, the full document is loaded based on the "FullDocumentID" field that is passed by the GET method into the URL. This all works fine, except at the beginning when no "FullDocumentID" is present in the URL. So I would like to include an if - else with isset to confirm that the FullDocumentID is in the URL. If not, I want a default document loaded (FullDocumentID = 1).
My approach is to qualify the db query like this:
$doc = mysql_query(
WHERE FullDocumentID = " . $_GET['FullDocumentID']);;
$_GET['FullDocumentID'] = '1';
But I get this error:
Parse error: syntax error, unexpected T_ELSE in /home/content/36/10807936/html/ecr/test4.php on line 44
Line 44 is blank following the last line of the above code. I have tried many variations, but need some help. Is there a better way to achieve my objective? Or is this approach feasible, but just need to tweak the code? Any help with this would be greatly appreciated.