Well, no hair left. I've tried this just about every which way (it feels like) but i just know it's something really, really stupid that i'm missing.
Underneath is a query. I've tested that there is at least one result row in the query so that seems to be ok. However, when i try to assign the result to a Session variable - $_SESSION['TimeSoFar'] -, it just doesn't seem to happen.
I believe the offending bit is this...
All this does is give it the value of $_Session['LessonID'], rather than the result of the query. Could someone please put me right? Feel free to mock if it helps.
Underneath is a query. I've tested that there is at least one result row in the query so that seems to be ok. However, when i try to assign the result to a Session variable - $_SESSION['TimeSoFar'] -, it just doesn't seem to happen.
PHP:
//get the time so far for that lessonid
$queryTimeAtStart = "SELECT '$_SESSION[LessonID]' FROM UserData
WHERE User_ID = '$_SESSION[User_ID]'
";
$resultTimeAtStart = mysql_query ($queryTimeAtStart);
$rowTimeAtStart = mysql_fetch_array ($resultTimeAtStart) ;
$num_rows = mysql_num_rows($resultTimeAtStart);
echo 'This is the number of results - '.$num_rows.'<br />';
$_SESSION['TimeSoFar'] = $rowTimeAtStart[$_SESSION['LessonID']];
PHP:
$_SESSION['TimeSoFar'] = $rowTimeAtStart[$_SESSION['LessonID']];
All this does is give it the value of $_Session['LessonID'], rather than the result of the query. Could someone please put me right? Feel free to mock if it helps.
