Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting an unexpected "End of File" error on this code. I cannot figure it out.
PHP
<pre><?php
	$sql = <<< EOT
       	SELECT CONCAT(tbl_practice_type.type_name, " ", tbl_practice.practice_name) as Sessions
       	FROM tbl_therapist_type
       	INNER JOIN tbl_practice ON tbl_therapist_type.practice_id = tbl_practice.practice_id
      	INNER JOIN tbl_practice_type ON tbl_therapist_type.type_id = tbl_practice_type.type_id
      	WHERE therapist_id = 2
      	AND tbl_therapist_type.type_id = 3
      	OR tbl_therapist_type.practice_id = 99
      	ORDER BY CASE WHEN type_name = 'Individual:' THEN '1'
        WHEN type_name = 'Couples:' THEN '2'
        ELSE practice_name END ASC
      EOT;
      $results = $db->query($sql);
      echo "<select name='mySelect'>";
      while ($row = $results->fetch(PDO::FETCH_OBJ)) {
      printf("<option value='%1$s'>%1$s</option>", $row->Sessions);
      }
      echo "</select>";
	?>	



What I have tried:

I have tried many different brackets, removed may semi-colons. Nothing seems to work.
Posted
Updated 25-Oct-20 4:37am

1 solution

The EOT sentinel must begin in column 1 of its text line. See PHP: Strings - Manual[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900