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

$query='SELECT * FROM banners ';

$row = mysqli_query($con,$query);
     
    if (mysqli_num_rows($row) >= 1) {
		//$r=mysqli_fetch_array($row)	;
			
		 while($r=mysqli_fetch_array($row)){
			 
			$cities[]=['id'=>$r['id'],'image'=>$r['image'],'url'=>$r['url']];
			
			// $cities['images']=$images;
			
			
		}   
		$errors['banners']=$cities;
		//$errors['product_images']=$images;
		$errors['success']='banners data';
    } else {
        
		$errors['success']='There is no banners found';
    }
	echo json_encode($errors);
?>