CasperSecurity
<?php
session_start();
include '../../../web/connection/connection.php';
$brand_id = $_REQUEST['brand_id'];
$db_handle = new DBController();
$selecth=$db_handle-> runQuery("SELECT * FROM brand ");
$db_handle = new DBController();
$selecthnum=$db_handle-> numRows("SELECT * FROM brand ");
$last_row = $selecthnum - 1;
if($selecthnum >= 1){
echo '{"status": "1",
"data":[';
$i =1;
foreach($selecth as $resulth){
$brand_id = $resulth['brand_id'];
$brand_short_name = $resulth['brand_short_name'];
$brand_name = $resulth['brand_name'];
echo'
{
"brand_id":"'.$brand_id.'",
"brand_short_name":"'.$brand_short_name.'",
"brand_name":"'.$brand_name.'"
}';
if($i <= $last_row){
echo ',';
}
$i++;
}
echo'
]}';
}else{
echo '{"status": "0",
"message":"Page Not found"
}';
}
?>