title: mysql select with 3 conditions issue
body: <p>Hello my problem is that if i change my ip but i have the same cookie it goes to the else statment and executing the query when it should go to fail. I dont know why it doesnt take the $cookie parameter in calculation.</p>
  
  <pre><code>&lt;?php
      require_once('../core/dbconfig.php');
      $dbc = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASS, DB_NAME);
      $ip_adress=$_SERVER['REMOTE_ADDR'];
      $cookie=$_COOKIE['Cookie'];
      $id_user=$_POST['id_user'];
  
      $query="Select * from IP_Cookie_Verify where ID_User='$id_user' and Cookie='$cookie' and IP='$ip_adress'";
      $result=mysqli_query($dbc,$query) or die("query failed: " . mysqli_error($dbc));
       if($row = mysqli_fetch_array($result))
       {      
              echo'fail';             
       }
       else
       {
       $query="Insert into IP_Cookie_Verify (IP,ID_User,Cookie) VALUES ('$ip_adress','$id_user','$cookie')";
                      $result=mysqli_query($dbc,$query) or die("query failed: " . mysqli_error($dbc));
  
  
       $queryz="Update `users` SET Voturi=Voturi+1 where id='$id_user'";
                      $resultz=mysqli_query($dbc,$queryz) or die("query failed: " . mysqli_error($dbc));
  
          $query="Select * from `users` where id='$id_user'";
          $result=mysqli_query($dbc,$query) or die("query failed: " . mysqli_error($dbc));
          while ($row = mysqli_fetch_array($result))
                      {
                      $voturi=$row['Voturi'];
                      }
                      echo''.$voturi.'';
       }
  </code></pre>