friend_search_refactored - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of friend_search_refactored.php

  1. <?php
  2. function cot_social_check_friend($userid, $friendid)
  3. {
  4.         global $db, $db_cot_social_friendslist;
  5.         $row = $db->query("SELECT * FROM $db_cot_social_friendslist WHERE (userid = $userid AND friendid = $friendid) OR (userid = $friendid AND friendid = $userid) LIMIT 1");
  6.         return $row->rowCount() > 0;
  7. }
  8.  
File Description
  • friend_search_refactored
  • PHP Code
  • 24 Jun-2021
  • 303 Bytes
You can Share it: