Jump to content

code showing blank page


shaneHoll

Recommended Posts

anyone help with the below code which isnt changing the balance field

 

<html> 
<body> 
<?php 

$mysqli = new mysqli("localhost","cl49-XXX","XXX"); 


$accountfrom=$_POST[accountfrom]; 
$accountto=$_POST[accountto]; 
$amount=$_POST[amount]; 

$result = $mysqli->query("SELECT * FROM member WHERE personID=$accountfrom"); 
$row = mysqli_fetch_array($result); 
$businesstype = $row['businesstype'] ; 




 

$select_result = $mysqli->query("SELECT * FROM member where personID='$accountfrom' "); 
$select = mysqli_fetch_array($select_result); 
$balance=$select['balance']; 
echo" Amount $amount"; 
if($balance>=$amount){ 

$result2 = $mysqli->query("UPDATE member 
SET balance = IF(personID = $accountfrom, balance-$amount, balance+$amount) 
WHERE personID IN ($accountfrom, $accountto)"); 

} 
else { 
echo" Not enough funds to do that"; 
} 


?> 
<h3>Transfer Complete</h3><br /> 

<table border='0'> 
<tr> 
<td><b><font color='black' weight='bold'>Date</b>                  </td> 
<td><b><font color='black'>Account From</b>                </td> 
<td><b><font color='black'>Account To</b>            </td> 
<td><b><font color='black'>Amount</b></td> 
<td><b><font color='black'>Balance</b></td> 
</tr> 
<?php 

$row2 = mysqli_fetch_array($result); 
$balance2 = $row2 ['balance']; 

echo" 
<td><font color='green'>09/11/2013</td> 
<td><font color='green'>$businesstype          </b></td> 
<td><font color='green'>$businesstype1                </b> </td> 
<td><font color='green'>£$amount                </td> 
<td><font color='green'>£$balance2</td> 
</tr> 
</table> 
"; 

?> 
</body> 
<html

>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.