Jump to content

Variable Displaying Over And Over


bob2588

Recommended Posts

        <?php
	include'db.php';
	$session= $_SESSION['username'];
	$query="SELECT * FROM login_ip WHERE login='$session'";
	$result= mysql_query($query);
	$count= mysql_num_rows($result);
	//$close = die($query);
	$min= $count - 1;
	$find= mysql_query("SELECT * FROM login_ip WHERE login= '$session' & times='$min'")or die(mysql_error());
	while($row = mysql_fetch_assoc($find))
  		{
	$lip=$row['ipaddress'];
	echo" <br>$min<br>$count";
		}        
	?>		

 

i worte the code above to pull the last ip address that a user has login form it is finding the ip adress but it is displaying like this

72.145.25.457
72.145.25.457
72.145.25.457
72.145.25.457
72.145.25.457

 

so i remove the $lip form the echo and place $min and $count in there and i am getting

1
2
1
2
1
2
1
2

Can some one please enplane why i am getting this problem thank you

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.