how this mysql supposed to look like?
$mysqli = new mysqli("localhost","root",'',"bank");
if ($mysqli -> connect_errno) {
echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
exit();
}
$sql ="SELECT userid FROM users WHERE userid=$_SESSION[userid] UNION SELECT SUM(despoit-transferAmount) AS money from money_transfer";
if ($result = $mysqli -> query($sql)) {
while ($obj = $result -> fetch_assoc()) {
printf($obj->money."$");
}
$result -> free_result();
}
$mysqli -> close();