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\' Link to comment https://forums.phpfreaks.com/topic/626-not-equal/ 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 Link to comment https://forums.phpfreaks.com/topic/626-not-equal/#findComment-2094 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()); Link to comment https://forums.phpfreaks.com/topic/626-not-equal/#findComment-2095 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.