<?php
include "config.php";
if (isset($_POST['update'])) 
    {
        
        extract($_POST);
        $abc=mysqli_query($connect,"select * from tbl_student_qualification where fld_stud_qualification='".$_POST['quali']."' and fld_stud_id!='".$_POST['quali']."'and fld_stud_qualification_delete='0'");

    if(mysqli_num_rows($abc)==1)
    {
       
            echo '<script type="text/javascript">'; 
            echo 'alert("Qualification Is Already Exist");';
            echo "window.location.href = 'view_stud_quali.php';";
            echo '</script>'; 
            return true;

        }    
        else
        {
            $query="Update tbl_student_qualification set fld_stud_qualification='".$quali."' where fld_stud_id='".$_GET['fld_stud_id']."' ";
            //echo $query."<br>";
            $row=mysqli_query($connect,$query) or die(mysqli_error($connect));
            if ($row) 
            {
                echo "<script>";
                echo "alert('Qualification Updated Successfully');";
                echo "window.location.href='view_stud_quali.php';";
                echo "</script>";                 
            }
            else
            {
                echo "<script>";
                echo "alert('Qualification Not Update.);";
                echo "window.location.href='view_stud_quali.php';";
                echo "</script>";
            }
        }    
    }
?>