ok added the error handling and this is the error
couldn't execute query UPDATE friends SET status = '2' WHERE index = '21'.You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'index = '21'' at line 1