referral statistics
Posted: Thu Feb 17, 2005 9:36 am
I'm complete lamer in PHP. I compilied this code from several others.
I want to receive statistic about number of referrals each user have.
My user table contains:
In config.inc.php
In referral.php
Result I get is just ID and Total Referrals row without any data.
Where is my mistake?
By the way I tried:
with the same success.
Mariela
feyd | please use the formatting tags when posting code. Bolding all your text doesn't help us, nor did the original title
I want to receive statistic about number of referrals each user have.
My user table contains:
Code: Select all
id
share(referrals)
own(same as id)
email
pass
creditsIn config.inc.php
Code: Select all
function report_ref()
{
$result = mysql_query("SELECT * FROM user WHERE own=id ORDER by id");
for($i=0; $row=mysql_fetch_array($result); $i++){
$listї$i]=$row;
}
return $list;
}Code: Select all
<?
require('config_inc.php');
$referral=report_ref();
?>
<?
require('header_inc.php')
?>
<table border="1" cellspacing="1" cellpadding="0" bordercolor="#000000">
<tr align="center">
<td width="20"><b>ID</b></td>
<td width="350"><b>Total Referrals</b></td>
</tr>
<?php
for($i=0; $i<count($reported); $i++)
echo '
<tr align="center">
<td width="20">'.$referralї$i]їid].'</td>
<td width="350">'.$referralї$i]їown].'</td>
</tr>
';
?>
</TD>
</TR>
</TABLE>
<?
require('footer_inc.php')
?>Where is my mistake?
By the way I tried:
Code: Select all
$result = mysql_query("SELECT id, share, own FROM user WHERE own=idMariela
feyd | please use the formatting tags when posting code. Bolding all your text doesn't help us, nor did the original title