Jump to content

How to do verifications


eiare360

Recommended Posts

I have a problem with my code

 

here is the case

there are two tables

one is

GRADES which contains (STUDENT_NUMBER,SUBJECT_CODE,GRADE,REMARKS)

and the other one is

SUBJECTSCS (SUBJECT_CODE,PRE_REQUISITE)

 

the process is

the system must first identify the available subjects before

having an output

 

IF THE PRE REQUISITE's remarks <> PASSED

the subject that should appear is the PRE REQUISITE ITSELF (re enroll)

 

IF THE PRE REQUISITE's remarks = PASSED

the subject that should appear is the SUBJECT that have that PRE REQUISITE

 

I hope you understand what I'm trying to explain

 

so here is my code

 

                       <?php

                                mysql_connect("localhost", "root", "")or die("cannot connect");
                                mysql_select_db("enrollment")or die("cannot select DB");
                                
                                
                                $querygradep="select * from grades where Student_Number='2007008337' and Remarks='Failed'";
                                $resultgradep=mysql_query($querygradep);
                                while($rowgp=mysql_fetch_array($resultgradep)){
                                $scodeop=$rowgp['Subject_Code'];
                                echo "<tr><td><input type='checkbox' name='subject[]' value='$scodeop' />$scodop</td>";
                                                           
                                                     
                       
                                $subjects="select * from subjectscs where pre_requisite<>'$scodeop'";
                                $subjects=mysql_query($subjects);
                                while($rown=mysql_fetch_array($subjects)){
                                $scoden=$rown['subject_code'];
                                $prereqn=$rown['pre_requisite'];
                                 echo "<tr><td><input type='checkbox' name='subject[]' value='$scoden' />$scoden</td>";
                                }
                                }
?>

 

Please dont get mad at me :)

Merry Christmas

 

 

Link to comment
https://forums.phpfreaks.com/topic/222569-how-to-do-verifications/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.