I'm trying to select a row using a session variable which is already defined, but when I try it comes up with the error:
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in viewmybookings.php on line 9
I have tried defining the session variable as a PHP variable and using the PHP variable however it still doesn't work
<?php
//first connect to the the database via your connection insert file
include'db.php';
$sql = "SELECT lesson.LessonName,lesson.LessonType,bookingtable.LessonDate,bookingtable.LessonStartTime,bookingtable.Duration,bookingtable.Statues FROM lesson
JOIN bookingtable
ON bookingtable.LessonID=lesson.Id
JOIN users
ON users.UserID = bookingtable.UserID
WHERE users.UserFirstName = <?php $_SESSION['UserID']?>";
//line 9 is the last line
?>