Problem With user restriction for transaction history

Hi All
I have this piece of code here, what it does it pulls out all the payment transaction from mysql to the page, I have a membership site setup and everything and every user has its own profile section, but this piece of code shows all the other users payment and records as well,

How Do I restrict each user to view their own payment based on a user? Can I do a quick hardcode?

[php]

<?php define("_VALID_PHP", true); require_once("init.php"); if (!$user->logged_in) redirect_to("index.php"); ?> <?php $transrow = $member->getPayments($user); ?>

Here you can view all your payment transactions.

Viewing Transactions

</tr>
<?php if($transrow == 0):?> <?php else:?> <?php foreach ($transrow as $row):?> <?php $image = ($row['status'] == 0) ? "pending":"completed";?> <?php $status = ($row['status'] == 0) ? 1:0;?>
</tr>
<?php endforeach;?>
<?php unset($row);?>
<?php if($pager->items_total >= $pager->items_per_page):?>
<tr style="background-color:transparent">
  <td colspan="8"><div class="pagination"><span class="inner"><?php echo $pager->display_pages();?></span></div></td>
</tr>
<?php endif;?>
<?php endif;?>
# Membership Title   Amount Payment Date Type of OS Status
<?php echo $core->msgAlert('Alert!You don\'t have any transactions yet...',false);?>
<?php echo $row['title'];?> (<?php echo $row['pp'];?>) <?php /*?><?php */?><?php echo $row['username'];?> <?php echo $core->formatMoney($row['rate_amount']);?> <?php echo $row['created'];?>

[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service