Nodral Posted April 20, 2011 Share Posted April 20, 2011 Hi All Can anyone give me any pointers as to why I'm getting the following error from the code below? <?php require_once "../config.php"; $sql = 'SELECT value FROM `mdl_scorm_scoes_track` WHERE scormid =338 AND element = "cmi.core.lesson_status"'; $sql = mysql_query($sql); while ($row = mysql_fetch_array($sql)){ switch($row['value']{ case "passed": $passed ++; break; case "incomplete": $incomplete++; break; case "completed": $completed++; break; default: $other++; break; } } echo "Passed = $passed <br/>"; echo "Incomplete = $incomplete <br/>"; echo "Completed = $completed <br/>"; echo "Others = $other<br/>"; ?> Parse error: syntax error, unexpected T_CASE in D:\Documents\AI24\Web\skooch\dccout\index.php on line 8 Cheers in advance guys Link to comment https://forums.phpfreaks.com/topic/234224-unexpected-t_case/ Share on other sites More sharing options...
Nodral Posted April 20, 2011 Author Share Posted April 20, 2011 All sorted, just spotted a missing bracket Link to comment https://forums.phpfreaks.com/topic/234224-unexpected-t_case/#findComment-1203864 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.