CasperSecurity
<?php
session_start();
include '../../../../web/connection/connection.php';
$connection = new createConnection();
$connection->connect();
$select="SELECT * FROM ddc_section WHERE is_active = 'yes'";
$query =mysqli_query($connection->myconn, $select);
$selectnum =mysqli_num_rows($query);
$result=mysqli_fetch_assoc($query);
$last_row = $selectnum - 1;
if($selectnum >= 1){
echo '{"status": "1",
"data":[';
$i =1;
foreach($select as $result){
$ddc_section_name = $result['ddc_section_description'];
echo'
{
"Section name":"'.$ddc_section_name.'"
}';
if($i <= $last_row){
echo ',';
}
$i++;
}
echo'
]}';
}else{
echo '{"status": "0",
"message":"Page Not found"
}';
}
?>