ok
Direktori : /home/ngwcolle/www/LIBRARY-NGWC/admin/ajax/ |
Current File : /home/ngwcolle/www/LIBRARY-NGWC/admin/ajax/getstudent1.php |
<?php // session_start(); error_reporting(0); // include('../includes/config.php'); include('../includes/dbconnection.php'); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // if (strlen($_SESSION['adid']==0)) { // header('location:logout.php'); if(!empty($_POST)) { $section = $_POST['secid']; $class = $_POST['clid']; $fy = $_POST['fy']; // $email = $_POST['email']; $query=$dbh->query("SELECT * from tblstudent where class=$class and section=$section and academicyear='$fy'"); // $row = $query->fetch(PDO::FETCH_ASSOC); // $response=$row; // if($row['vacancy'] > 0){ // echo $row['vacancy']; // // .' Seats Vacancy exists for this Section!'; // } else{ // echo '0'; // } // if($query->rowCount()>0) // { // // echo $section; // echo $query->rowCount(); // } // else{ // echo($query->error); // } while($row = $query->fetch(PDO::FETCH_ASSOC)){ // while( $row = mysqli_fetch_array($result) ){ $userid = $row['id']; $name = $row['studentname']; $stid=$row['studentcode']; $users_arr[] = array("id" => $userid, "name" => $name,"stcode"=>$stid); } echo json_encode($users_arr); } ?>