$sql = "SELECT * FROM schedule ".
"WHERE CurriID ON (SELECT CurriID FROM curriculum ".
"WHERE (Pre_Requisite LIKE (SELECT CONCAT('%',SubjCode) ".
"FROM studgrade WHERE (Grade >=1 and Grade <=3) AND StudentNumber='$id') ".
"AND Pre_Requisite LIKE (SELECT CONCAT(SubjCode,'%') FROM studgrade WHERE ".
"(Grade !='5' and Grade !='INC') AND StudentNumber='$id')) OR Pre_Requisite ON ".
"(SELECT SubjCode FROM studgrade WHERE (Grade !='5' AND Grade !='INC') AND StudentNumber='$id')";
I just try to view all the subject that available in the schedule of the subject which is base on the subject that they passed. I used the CONCAT function in query for joining the string of '%' and subjCode. but the result is ..
mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\insertion\outputschedule.php on line 18
Can anyone help me some tips in using CONCAT??