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

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
	$user_id=$_POST['user_id'];
  
   $fromuser=mysqli_query($con,"SELECT id,first_name,last_name,point_wallet FROM users WHERE id='".$user_id."'");
   $setting=mysqli_query($con,"SELECT id,card_image FROM settings WHERE id=1");
   while($r1=mysqli_fetch_array($fromuser)){
				 $images[]=['id'=>$r1['id'],'first_name'=>$r1['first_name'],'last_name'=>$r1['last_name'],'balance'=>$r1['point_wallet']];
			 }
    while($r12=mysqli_fetch_array($setting)){
				 $images12[]=['id'=>$r12['id'],'card_image'=>$r12['card_image']];
			 }
		
		
		
		 if($fromuser){
		
		
	     	$errors['success']=true;
	     	$errors['user']=$images;
	     	$errors['setting']=$images12;
	     	$errors['message']='data';
	 }else{
	     $errors['success']=false;
	     $errors['message']='Somthing went wrong !!';
	 }
   
echo json_encode($errors);
}