Php MySql friend request 0 row affected
<p>Guys i have problem when try to update col in table. </p>

<p>I have table where i store friend relationship and friend requests.</p>

<p><strong>Friend table looks like this:</strong> </p>

<pre><code>`friend_one` INT(11) ,
`friend_two` INT(11) ,
`status` ENUM('0','1','2') DEFAULT '0'
</code></pre>

<p><strong>I use the following insert statement for adding a friend.</strong></p>

<pre><code>INSERT INTO friends
(friend_one,friend_two)
VALUES
('$user_id','$friend_id');
</code></pre>

<p>All that work fine but whan i try to confirm friend request to update status to 1 return me 0 row affected but query is successful.</p>

<p><strong>For confirm request :</strong></p>

<pre><code>UPDATE friends
SET status="1"
WHERE
(friend_one="$user_id" OR friend_two="$user_id")
AND
(friend_one="$friend_id" OR friend_two="$friend_id");
</code></pre>

<p>And all time is the some:</p>

<blockquote>
  <p>1 queries executed, 1 success, 0 errors, 0 warnings</p>
  
  <p>Query: UPDATE friends SET STATUS=1 WHERE (friend_one= 2 OR friend_two=
  2) AND (friend_one=1 OR friend_two=1)</p>
  
  <p>0 row(s) affected</p>
  
  <p>Execution Time : 0.037 sec Transfer Time  : 0 sec Total Time     :
  0.038 sec</p>
</blockquote>

<p>I have only one record in table but never change status to 1: </p>

<pre><code>friend_one  friend_two  status  
----------  ----------  --------
         2           1  0       
</code></pre>