name : getdata.php
<?php 

include('config/config.php');
require("mysql2json.class.php");

$ID     =   $_GET['ID'];
$type   =   $_GET['TYPE'];
if($type=='types'){
    $query="SELECT t_id, t_name FROM types ORDER BY t_id ASC ";
}else if($type=='cats'){
    $query="SELECT c_id, c_name FROM categorys ORDER BY c_id ASC ";
}

$res = $conn->query($query);
$num= mysqli_affected_rows($query)

$json=new mysql2json;
$data=$json->getJSON($result,$num);
echo $data;

?>

© 2024 UnknownSec