Jump to content

Unexpected T_CASE


Nodral

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.