$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??

8 Years
Discussion Span
Last Post by Dukane

That error message means that the result is not returned from the database. Typically, if you have bad SQL the error message will tell you about syntax of the query. Can you show us a little more code? Are you calling mysql_query()?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.