1
<?php
include('../dbh.php');

$member_id = $_POST['member_id'];


$sql = "SELECT * FROM user_reg WHERE member_id = '$member_id' LIMIT 1";

$sql_deposit = "SELECT SUM(dep_amount) as total_deposit FROM user_deposit WHERE member_id = '$member_id'";

$sql_withdraw = "SELECT SUM(withdraw_amount) as total_withdraw FROM user_withdraw WHERE member_id = '$member_id'";

$d_query = mysqli_query($conn,$sql_deposit);
$deposit = mysqli_fetch_assoc($d_query);

$w_query = mysqli_query($conn,$sql_withdraw);
$withdraw = mysqli_fetch_assoc($w_query);

$query = mysqli_query($conn,$sql);
$data = mysqli_fetch_assoc($query);

$array = ['name'=>$data['member_name'], 'n_id'=>$data['n_id'],'balance'=>$deposit['total_deposit'] - $withdraw['total_withdraw']];
#echo$data['photo'];
//echo $data['member_name'];

echo json_encode($array);
?>
 

Post a Comment

Emoticon
:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

 
check pagerank
Top