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

$query="SELECT * FROM smsbygroup WHERE group_id=".$_GET['group_id'];

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