title: If row is equal to
body: <p>I'm trying to get an error on my rating script, When somebody like an article the ip goes into the db. That goes fine, but I cant the ip from db equal to check ip. I need to receive a message which says `You already voted'</p>
  
  <pre><code>&lt;?php
  $user = new User();
  if($user-&gt;isLoggedIn())
  {
      if (!empty($_SERVER['HTTP_CLIENT_IP']))
      {
          $ip=$_SERVER['HTTP_CLIENT_IP'];
          //Is it a proxy address
      }
      elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
      {
          $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
      }
      else
      {
          $ip=$_SERVER['REMOTE_ADDR'];
      }
  
      //The value of $ip at this point would look something like: "192.0.34.166"
      $ip = ip2long($ip);
      $id = $row-&gt;id;
  
      // GET IP
      $q_50 = $db-&gt;query("SELECT INET_NTOA(ip) FROM vote WHERE cID = '$id'") or die($db-&gt;error);
      if($row_50 = $q_50-&gt;fetch_object());
      if($row_50-&gt;ip === $ip)
      {
          echo 'You already voted';
      }
  </code></pre>