Nicole
Posts: 586
|
Posted: 10/12/2004, 2:48 AM |
|
Hello,
It appears that your query is valid every time and thus mysql_query() returns true. Quote from PHP manual:
"A non-FALSE return value means that the query was legal and could be executed by the server. It does not indicate anything about the number of rows affected or returned. It is perfectly possible for a query to succeed but affect no rows or return no rows."
I suggest that you try DLookUp() function instead and count number of records which match the WHERE:
$result=0;
$result=DLookUp("studentclass", "count(*)", "student_id =". $fldstudent_id." AND class_id = ".$fldclass_id ." AND course_id = ". $fldcourse_id);
if ($result>0)
$sstudentclass1Err .= "Student is currently enrolled <br>in selected class";
_________________
Regards,
Nicole |