MMCT TEAM
Server IP : 162.214.80.37  /  Your IP : 216.73.216.83
Web Server : Apache
System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : imyrqtmy ( 2189)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/imyrqtmy/public_html/asiatourhub/admin/webapp/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/asiatourhub/admin/webapp/getSubcategory.php
<?php 
include'../dbc.php';
	header('Access-Control-Allow-Origin: *');//old
	header('Access-Control-Allow-Methods: GET, POST,PATCH,PUT,DELETE,OPTIONS');
	header('Access-Control-Allow-Headers: Origin,Content-Type,X-Auth-Token');
	header('Content-Type:application/json');//old
	
$sqlC=mysqli_query($conn,"select * from tbl_category ") or die(mysqli_error($conn));
while($rows=mysqli_fetch_assoc($sqlC)){
    $categoryNameAry[$rows['id']]=$rows['name'];
}

	$sql=mysqli_query($conn,"select * from tbl_subcategory") or die(mysqli_error($conn));
	if(mysqli_num_rows($sql)>0)
	{
		$response=array();
		$showname2=array();
		$responseFinal=array();
		while($row=mysqli_fetch_assoc($sql))
		{
		
			extract($row);
			$showname=array();
			$showname["id"]	        =$id;
			$showname["catname"]	=$categoryNameAry[$category_id];
			$showname["name"]       =$name;
			// $showname["image"] ="http://localhost/common_product/media/product/".$image;

			array_push($response,$showname);
		}
			$showname2["success"] =1;
			$showname2["category"] =$response;
			array_push($responseFinal,$showname2);
		echo json_encode($responseFinal);
		
	}
	else
	{
		$response=array();
		$showname=array();
		$showname["success"]="0";
		array_push($response,$showname);
		echo json_encode($response);
	}
			
			
?>

MMCT - 2023