<?php
require_once 'config.php';
//$error=false;
$errors=array();
$cities=array();
$images=array();


$query='SELECT a.* FROM trendiframe a WHERE id=1';//.$_GET['banner_id'];

$row = mysqli_query($con,$query);
     
    if (mysqli_num_rows($row) >= 1) {
		//$r=mysqli_fetch_array($row)	;
			
		 //while(
		 $r=mysqli_fetch_array($row);//);
		 //{
		//echo 0"test";	 
			$cities=['id'=>$r['id'],'price'=>$r['price'],'image'=>$r['image'],'about'=>str_replace("\r\n","",$r['about']),'faq'=>str_replace("\r\n","",$r['faq']),'howitwork'=>str_replace("\r\n","",$r['howitwork']),'benefits'=>str_replace("\r\n","",$r['benefits'])];
			
			// $cities['images']=$images;
			$query1='SELECT * FROM frame_img where frame_id=1 ORDER BY id DESC ';
			$row1 = mysqli_query($con,$query1);
			while($r1=mysqli_fetch_array($row1)){
				$images[]=['id'=>$r1['id'],'image'=>$r1['image']];
			}
			
	//	}   
		$errors['trendiframe']=$cities; 
		$errors['frameimages']=$images;
		//$errors['product_images']=$images;
		$errors['success']='Trendy Frame data';
    } else {
        
		$errors['success']='There is no data found';
    }
	echo json_encode($errors);
?>