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

$query='SELECT * FROM imagebyfolder where leaderid='.$_GET['user_id'];// where leaderid='.$smsflag;

$row = mysqli_query($con,$query);
     
    if (mysqli_num_rows($row) >= 1) {

			
		 while($r=mysqli_fetch_array($row)){
			 
			//$cities[]=['id'=>$r['id'],'user_id'=>'leaderid','image'=>$r['image'],'folder_id'=>$r['folderid']];	
			$cities[]=['id'=>$r['id'],'user_id'=>$r['leaderid'],'image'=>$r['image'],'folder_id'=>$r['folderid']];	
			
		}   
		//$errors['banners']=$cities;
		
    } else {
        
		
    }

	$city=$cities;
	//	shuffle($city1);
		
		if ((count($city)==0)){
        
		$errors['success']='There is no image found';
    } else {
		$errors['success']='All Image data';
	//	shuffle($city1);	
	$errors['count']=count($city);
		$errors['imagebyfolder']=$city;   
	}
	 
	echo json_encode($errors);
	
?>