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

 $query="SELECT * FROM notifications WHERE status=1";

$row = mysqli_query($con,$query);
     
    if (mysqli_num_rows($row) >= 1) {
		
			
		 while($r=mysqli_fetch_array($row)){
			$cities[]=['id'=>$r['id'],'date'=>$r['date'],'notification'=>$r['notification'],'status'=>$r['status']];
			
			
		}   
		$errors['notifications']=$cities;
		$errors['success']='notifications data';
    } else {
        
		$errors['success']='There is no offers found';
    }
	echo json_encode($errors);
?>