我有两张桌子:
sk_accounts //details of user
- acnt_user_id
- acnt_fname //名字
- acnt_lname
- acnt_profile_picture
- acnt_member_class
很快........
sk_following //table containing details of users who are following others
ID
- flwing_follower_id //被其他关注者关注的用户的id
- flwing_following_user_id
以下日期
我想根据以下 Mysql 代码显示关注者的详细信息。不幸的是,即使有 3 行,它也会返回零行。我的查询是这样的:
$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;
注意:$id 和 $name 包含值请帮助我。在此先感谢。