-2

I have error :-

Parse error: syntax error, unexpected T_STRING in php record set in

$query_Recordset2 = "SELECT stu_ID,stu_name, GROUP_CONCAT(if(class_no="lec_1", `attstatus`, NULL)) AS 'Lecturer 1', GROUP_CONCAT(if(class_no="lec_2", `attstatus`, NULL)) AS 'Lecturer 2' FROM attendance WHERE session_ID="1" GROUP BY stu_ID,stu_name";

There free syntax error during testing at dreamweaver but when open the php file in browser pop out this error.Any solution to fix it?

Thanks

Jack
  • 1
  • 2

1 Answers1

0

Replace your string with this

$query_Recordset2 = "SELECT stu_ID,stu_name, GROUP_CONCAT(if(class_no='lec_1', attstatus, NULL)) AS 'Lecturer 1', GROUP_CONCAT(if(class_no='lec_2', attstatus, NULL)) AS 'Lecturer 2' FROM attendance WHERE session_ID GROUP BY stu_ID,stu_name";
Kuldeep Dangi
  • 4,126
  • 5
  • 33
  • 56
  • still does not work even changed from "lec_2" to 'lec_2' and have syntax error in dreamweaver – Jack Apr 15 '15 at 06:20
  • This was only for your php error you specified in question, There are mysql error as well in query. if you can provide little info what exactly you are trying. I can provide with the right one – Kuldeep Dangi Apr 15 '15 at 06:52
  • finally solve it..thanks for provide right code – Jack Apr 15 '15 at 06:58