How to calculate debit credit and balance in SQL | how to display user balance in mysql
<?php $connpans = mysqli_connect(‘localhost’,’user’,’pass’,’db’); $sqlp=”select * from login_user”; $resultp=mysqli_query($connpans,$sqlp); $userdata=mysqli_fetch_assoc($resultp); $wallet = $userdata[‘wallet’]; if ($userdata[‘wallet’] == “”) { $balance = 0; } else { $balance = $userdata[‘wallet’]; ///output balance: 100.9872749837958…