Hi guys, i have payments stored in a table split into 1 or 0 (1 for inwards payment and 0 of outwards payment) and then amount stored for type of payment eg 1 and then 15 would indicate a inwards payment of $15. Below shows the code i am working with and the bolded area is my attempt of the equation. Im greatfull of anyhelp that i receive
global $frm;
mysql_connect("xxx", "xxx", "xxx") or die(mysql_error());
mysql_select_db("mikk") or die(mysql_error());
$frm = $frm['lid'];
$data = mysql_query ("SELECT hl_listings.date_added, hl_listings.name, hl_listings.hyip_status, hl_statistics.type, hl_statistics.amount FROM hl_listings, hl_statistics WHERE (hl_statistics.listing_id = '$frm') and(hl_listings.id = '$frm')");
$info = mysql_fetch_array( $data )
?>
<table frame=border background ="http://www.TheHyipSite.com/images/Image_bk.gif" cellspacing="10">
<tr>
<td><br><br><br><br><br></td>
</tr>
<tr>
<td><center><?php print $info[name];?></td>
</tr>
<tr>
<td><center><?php print $info[date_added]= date ('d.m.y');?>
</td>
</tr>
<tr>
<td><center><?php print Sum $info[amount]Where $info[type]=1;?></td>
Thanks guys
Mikk