I have made this codes that registers the students using their learner id. And of course i wanted to make sure that there will be no duplication of learner id as students registered.Thes e are my codes.
Everytime there is a duplication of learner id by using this code on the other page.
The log in page give me notice
This Learner Id(
Notice: Undefined index: learner_id in C:\xampp\htdocs \a\Student_logi n.php on line 61
) already exists. Please try again with another Learner Id.
How do i fix this one. Please advise.
Code:
/*
This block is used to check whether the student_id already exists in database.
*/
$select_query="select student_id from student_information where learner_id = '$learner_id'";
$result_set = mysql_query($select_query,$link_id);
if($row = mysql_fetch_array($result_set)){
$flag="exists";
header("location:Student_login.php?flag=$flag&student_id=$student_id");
die();
}
else{
/*
This block is used to insert the learners record in database
if the student_id is not yet registered in the database.
*/
mysql_query("SET AUTOCOMMIT = 0 ");
if(mysql_error() != null){
die(mysql_error());
}
Code:
>This Learner Id( <?php $_GET['learner_id'] ?> ) already exists. Please try again with another Learner Id.</td>
This Learner Id(
Notice: Undefined index: learner_id in C:\xampp\htdocs \a\Student_logi n.php on line 61
) already exists. Please try again with another Learner Id.
How do i fix this one. Please advise.
Comment