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

$query="SELECT * FROM smsgroups ORDER BY id DESC";

$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'],'group_name'=>$r['group_name'],'status'=>$r['status'],'created_at'=>$r['created_at']];
			
			// $cities['images']=$images;
			
			
		}   
		$errors['popupgroups']=$cities;
		//$errors['product_images']=$images;
		$errors['success']=true;
		$errors['message']='smsgroups data';
    } else {
        
		$errors['success']=false;
		$errors['message']='There is no smsgroups found';
    }
	echo json_encode($errors);
?>