Jump to content

not equal


Blu_Smurf

Recommended Posts

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 :D

 

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
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.