<?php
$this->user_id = $_SESSION['user_id']=$user->id;
//create a database connection
mysql_connect("host","user","pass") or die("Error:".mysqlerror());
//select database
mysql_select_db("db");
?>
<html>
<body>
<link href="tab.css" rel="stylesheet" type="text/css" media="all" />
<table id="box-table-b">
<tr>
<th>User ID</th>
<th>Status</th>
<th>I.P</th>
<th>Offer Id</th>
</tr>
<?php
$result = mysql_query("SELECT * FROM clicks where userId='$id'");
//return the array and loop through each row
while ($row = mysql_fetch_array($result))
{
?>
<tr>
<td><?php echo $row['userId'];?></td>
<td><?php echo $row['status'];?></td>
<td><?php echo $row['clickIp'];?></td>
<td><?php echo $row['offerId'];?></td>
</tr>
<?php
}
?>
</table>
</body>
</html>
I tried adding different session variables but there is no way I can get users id in result section. Please someone tell me what code can i add to get users id.