hello,
im trying to make an attendance record. im using a form where im entering two values,
1. Date
2. Absent Students
im entering roll numbers of the absent students separated by "-" like this: 5-10-15-20-21-23. these roll numbers are then stored into a mysql database in the same format. now there are all 50 students which are stored in a different table. i just want to match these roll numbers who are absent against all 50 students. if the roll number is there in the absent students then it will not be inserted else it will be inserted into a different field named as present in the same table in the same format as 1-2-3-4-6-7-8-9-11. the roll number which is appeared in the absent will not be appeared in this field. im using explode to make an array of roll numbers which are entered in the form. following is what im doing:
	rno = roll number of the students
please tell me how i can do this. thanx
					im trying to make an attendance record. im using a form where im entering two values,
1. Date
2. Absent Students
im entering roll numbers of the absent students separated by "-" like this: 5-10-15-20-21-23. these roll numbers are then stored into a mysql database in the same format. now there are all 50 students which are stored in a different table. i just want to match these roll numbers who are absent against all 50 students. if the roll number is there in the absent students then it will not be inserted else it will be inserted into a different field named as present in the same table in the same format as 1-2-3-4-6-7-8-9-11. the roll number which is appeared in the absent will not be appeared in this field. im using explode to make an array of roll numbers which are entered in the form. following is what im doing:
Code:
	
 extract($_POST);
    
    $selectStudent = $this->database->Query("select * from students");
    $strStudentAbsent = explode("-", $strAbsent);  
    while($result = mysql_fetch_assoc($selectStudent)){  
    foreach($strStudentAbsent as $a){
      $a = (int)$a;
         
        if($result['rno']<>$a){
            echo $result['rno']."Present <br />";
        } else{
            
            echo $result['rno']."Absent <br />";
            
        }
    }
    
    }
please tell me how i can do this. thanx
Comment