Its american, althought im getting deiffernt errors now
someone helped me code this right
<?
session_start();
$page="Refferals";
include"header.php";
include"mysql.php";
if($_SESSION['loggedin']==1){
$getuser=mysql_query("select * from users where id={$_SESSION['userid']}",$c);
echo $query;
$ui=mysql_fetch_array($getuser);
$getuser=mysql_query("select * from users where id={$_SESSION['userid']}",$c) or die(mysql_error());
$ui=mysql_fetch_array($getuser);
$id = ($ui['username']); //change this as you need, can be queried from a form if you want
$query = "SELECT referrals FROM users WHERE id = ".$id;
$data = mysql_query($query) or die(mysql_error());
$results = mysql_fetch_array($data);
echo "<div align='center'>Referrals: ".$results['referrals']."<hr width='15%'></div>";
$id = ($ui['username']); //change this as you need, can be queried from a form if you want
$query = "SELECT id, username FROM users WHERE referrer = '[u][b]admin[/b][/u]'";
$data = mysql_query($query) or die(mysql_error());
echo "<div align='center'>";
while($results = mysql_fetch_array($data)) {
echo $results['id']." - ".$results['username']."<br />";
}
echo "</div>";
} else {
echo "<div align='center'>Please <a href='login.php?ref=refferals'>log in</a> to see your referrals.</div>";
}
?>
<table width="90%">
<tr>
<th colspan="2">
<div align="center">Refferals</div>
</th>
</tr>
<tr><th width="50%">User ID</th><th>Username</th></tr>
<tr>
<td valign="top">
<?
"<div align='center'>";
while($results = mysql_fetch_array($data)) {
echo $results['id'];
}
echo "</div>";
?>
</td>
<td valign="top">
</td>
</table>
<h2>Refferal Banners</h2>
<p class="post-by"></p>
<p>
Get paid faster and easier, by using these banners. Got a blog? Maybe a Site? Use these banners to get refferals.</p>
<p>
<br><u>HTML Code:</br></u>
<textarea name='styled-area' id='styled' onclick='this.focus();this.select()' readonly>><a href='<?=$siteurl;?>/?ref=<?=$ui['username'];?>'><img src='<?=$siteurl;?>/images/banner1.gif' border='0' /></a></textarea><br><br>
<br><u>BB Code:</br></u>
<textarea name='styled-area' id='styled' onclick='this.focus();this.select()' readonly>>[url='<?=$siteurl;?>/?ref=<?=$ui['username'];?>'][img]<?=$siteurl;?>/images/banner1.gif[/img][/url]></textarea><br><br>
</p>
<?
include"side.php";
include"footer.php";
?>
This query here
$id = ($ui['username']); //change this as you need, can be queried from a form if you want
$query = "SELECT id, username FROM users WHERE referrer = '[u][b]admin[/b][/u]'";
$data = mysql_query($query) or die(mysql_error());
More specificially the admin bit, when i log in on another account, eg 'test', it gives me this error
Quote
Unknown column 'test' in 'where clause'
Another thing is that it echo's the query fine, but when in a table it doent?
Anyone help?
I have msn if you ned it