Blu_Smurf Posted June 23, 2003 Share Posted June 23, 2003 Ok, I am making a site counter thats a site logger as well, now, I am trying to ge it it get all tables counter then with mysql_num_rows and spit out the number of all rows that are not equal to a users IP. I have tried it a number of ways, this one is the only way I don\'t get an error: $sql=mysql_query("SELECT ip!=\'$ip\' FROM counter") or die(mysql_error()); Im using $ip = $_SERVER[\'REMOTE_ADDR\']; to grab the ip btw Now, am I right in that syntax to use it? Im thinking it needs to be select * from counter where ip!=\'$ip\' but I get errors when I do that. Any suggestions? Edit: nm got it, I forgot to use the \' marks when using ip!=\'$ip\' Quote Link to comment Share on other sites More sharing options...
shivabharat Posted June 23, 2003 Share Posted June 23, 2003 Try this select * from counter where Ip<> $ip Quote Link to comment Share on other sites More sharing options...
Blu_Smurf Posted June 23, 2003 Author Share Posted June 23, 2003 hehe I got it, just forgot my apostrohpe\'s lol.. $sql=mysql_query("SELECT * FROM counter WHERE ip!=\'$ip\'") or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.