friend_search - 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.
Result of php executing
Full code of friend_search.php
- <?php
- function cot_social_check_friend($userid, $friendid)
- {
- global $db, $db_cot_social_friendslist;
- $sql1 = $db->query("SELECT * FROM $db_cot_social_friendslist WHERE userid = $userid AND friendid = $friendid LIMIT 1");
- $friendsExist1 = $sql1->rowCount();
- $sql2 = $db->query("SELECT * FROM $db_cot_social_friendslist WHERE userid = $friendid AND friendid = $userid LIMIT 1");
- $friendsExist2 = $sql2->rowCount();
- if($friendsExist1 > 0){$active = $sql1->fetch();}
- if($friendsExist2 > 0){$active = $sql2->fetch();}
- if($friendsExist1 > 0 || $friendsExist2 > 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
File Description
- friend_search
- PHP Code
- 24 Jun-2021
- 617 Bytes
You can Share it:
Latest PHP Pastes