ok
Direktori : /home/ngwcolle/public_html/LIBRARY-NGWC/admin/ajax/ |
Current File : //home/ngwcolle/public_html/LIBRARY-NGWC/admin/ajax/getsection.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']; // $email = $_POST['email']; $query=$dbh->query("SELECT * from tblsection where classid='$class'"); // $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['sectioncode']; $users_arr[] = array("id" => $userid, "name" => $name); } echo json_encode($users_arr); } ?>