| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/(Del)pathways.org.hk/MIS20140127/old20140407/staff/ |
Upload File : |
<?php
/*
$DB = new mysqli('localhost', 'root', '', 'pathwaysmisdb');
if (mysqli_connect_errno()) {
echo 'File Connect' . mysqli_connect_error();
exit();
}
*/
include_once '../include/DBConnect.php';
//if ($_POST['PID']) {
// $PID = $_POST['PID'];
//$Name = 'Lok';
//$query = "select * from product where Product_ID='$PID'";
//$query = "select * from subject where deleted = '0'";
//$result = $dbh->query($query);
$Arrays= array();
$deleted = 0;
$query = "select * from subject where deleted = ? ORDER BY sort";
$result = $dbh->prepare($query);
$result->bindParam(1,$deleted);
$result->execute();
$subject = $result->fetchAll();
foreach ($subject as $value) {
echo json_encode($value);
}
//while ($row = $result->fetch_object()) {
/*
while ($row = $result->fetch(PDO::FETCH_OBJ)) {
$ID = $row->subject_id;
$PDes = $row->sub_name;
$PC = $row->code;
$Array = array(
"subject_ID" => $ID,
"subject_Description" => $PDes,
"subject_code" => $PC,
);
$Arrays[] = $Array;
}*/
//mysqli_close($dbh);
/*
foreach ($Arrays as $value) {
echo json_encode($value);
}*/
//echo json_encode($Arrays[0]);
//echo json_encode($Arrays[1]);
//echo json_encode($Arrays[2]);
//}
?>