Hi,
I have an issue with a development function i am working on i have a function which basically contains users information which contaiins user information but when i have it in a html form it doesnt print out the information as i hoped.
This is my php function
function userinfo()
{
global $user,$rank,$username,$password,$email,$aim,$msn,$mid,$recruitedby,$joineddate,$disable,$logindays,$web;
include("dbconnect.php");
$username=$_SESSION['user'];
$u="SELECT * FROM members WHERE username='$user'";
$rs=mysqli_query($con,$u);
if(!$rs)
{
//
echo "Error".mysqli_error($con);
//
}
else
{
//
$count=$rs->num_rows;
if($count>0)
{
while($data=$rs->fetch_assoc())
{
//
$user = $data['username'];
$rank = $data['rank'];
$username = $data['username'];
$password = $data['password'];
$email=$data['email'];
$aim=$data['aim'];
$msn=$data['msn'];
$mid=$data['mid'];
$recruitedby=$data['Recruitedby'];
$joineddate=$data['joineddate'];
$disable=$data['disable'];
$logindays=$data['logindays'];
$web=$data['web'];
//
}
}
//
}
}
When i try to call it from another file called membersarea they html code i am using is
<?
userinfo();
?>
<table width="390" border="1">
<tr>
<th colspan="2">Your Profile</th>
</tr>
<tr>
<td>Member</td>
<td><? echo $username;?></td>
</tr>
<tr>
<td>Email</td>
<td><? echo $email;?></td>
</tr>
<tr>
<td>Recruited By:</td>
<td><? echo $recruitedby;?></td>
</tr>
<tr>
<td>Date Joined</td>
<td><? echo $joineddate;?></td>
</tr>
When i preview it on my site i cant see what $email and $recruitedby Values are being displayed for the members information?
i thought this would be a good way instead of re-using the same code all the time?
Can anyone tell me what am i doing wrong?