php - list friend from sql -


i trying echo friends table not echoed. put following sql:

$sql="select user2 , user1 friends        user1 = '$log_username' or user2 = '$log_username'        , accepted ='1' , isblocked='1' ";  $query = mysqli_query($db_conx, $sql);  

and table:

table screenshot

and $log_username = mtest, highlight rows corresponding result didn't get. there know there logic error. please me out this.

select user2 , user1 friends; fetch friends user1,user2 column , after (user1 = '$log_username' or user2 = '$log_username') condition , fetch user match atleast 1 column last condition filter accept 1 , friend blocked 0.

$sql="select user2 , user1 friends        (user1 = '$log_username' or user2 = '$log_username')        , (accepted ='1' , isblocked='0') ";  $query = mysqli_query($db_conx, $sql);  

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -