What I'm doing is summing up the number of tables according to the id of the logged-in user, so I'm making no value is proven.
Bank:
id id_affiliate user_ip date
1 2 162.70.25.00 2015-11-06 08:49:47
2 1 162.70.25.00 2015-11-06 09:49:47
3 2 162.70.25.00 2015-11-06 10:49:47
4 2 162.70.25.00 2015-11-06 11:49:47
2 1 162.70.25.00 2015-11-06 00:49:47
Code:
<?
$connect = mysql_connect('localhost', 'root', 'pass');
if (!$connect) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database", $connect);
$consulta = mysql_query("SELECT id_affiliate FROM easy_affiliate_stats WHERE id_affiliate = . "$_SESSION["id_affiliate"], $connect);
//Conta quantos registros possuem na tabela
$total= mysql_num_rows($consulta);
//Mostra o valor
echo "Atualmente há $total registros";
?>