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

$query='SELECT * FROM users WHERE role=2 AND status=1';

$row = mysqli_query($con,$query);
     
    if (mysqli_num_rows($row) >= 1) {
		
			
		 while($r=mysqli_fetch_array($row)){
			$cities[]=['id'=>$r['id'],'merchant_name'=>$r['first_name'],'merchant_email'=>$r['email'],'merchant_lo'=>$r['profile_pic']];
			
			
		}   
		$errors['merchants']=$cities;
		$errors['success']='merchants data';
    } else {
        
		$errors['success']='There is no merchants found';
    }
	echo json_encode($errors);
?>