<?php

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

if ($_SERVER['REQUEST_METHOD'] === 'GET') {
	
   
   
	$query = "SELECT * FROM users WHERE id='".$_GET['user_id']."'";
	
	
    $row = mysqli_query($con,$query);
     
    if (mysqli_num_rows($row) >= 1) { 
		while($r=mysqli_fetch_array($row)){
			
			$errors['user_id'] = $r['id'];
			
			$errors['credits']=$r['credits'];
			$errors['vouchers']=$r['vouchers'];
			$errors['points']=$r['point_wallet'];
			
		}
		$errors['success']='User Wallet';
    } else {
        //$error=true;
		$errors['success']='No data found !!';
    }
	echo json_encode($errors);
  
}

?>