I have two tables:
sk_accounts //details of user
- acnt_user_id
- acnt_fname //first name
- acnt_lname
- acnt_profile_picture
- acnt_member_class
so on........
sk_following //table containing details of users who are following others
id
- flwing_follower_id //id of the user who are followed by other followers
- flwing_following_user_id
following_date
I want to display details of the follower based on the following Mysql code.Unfortunately it returns zero rows eventhough there are 3 rows.My query is like this:
$query_following = "SELECT sk_following.flwing_following_user_id, sk_accounts.acnt_fname, sk_accounts.acnt_lname, sk_accounts.acnt_member_class, sk_accounts.acnt_profile_picture FROM sk_following INNER JOIN sk_accounts WHERE sk_following.flwing_follower_id='$id' AND sk_accounts.acnt_user_id=sk_following.flwing_following_user_id AND CONCAT(sk_accounts.acnt_fname,' ',sk_accounts.acnt_lname)='$name'"; $result_following = mysql_query($query_following); $count_following = mysql_num_rows($result_following); echo $count_following;
Note:$id and $name contain values Kindly help me.Thanks in advance.