我的好友 (user_user_friend [id, user_id int(11,index), friend_id(int[11]), input_time(datetime)])
建立一个 好友的关联表 id自动增长的 user_id 是我自己的关联 id friend_id 是好友的关联id
我怎么查询两个表 能查出 我的一个 user_id =6 的好友的详细信息
建立一个 好友的关联表 id自动增长的 user_id 是我自己的关联 id friend_id 是好友的关联id
我怎么查询两个表 能查出 我的一个 user_id =6 的好友的详细信息
解决方案 »
- 求助怎么将#cccccc这个颜色格式转换为(255,255,0)等 这样的格式啊?有什么思路 ? 在网上搜索的方法说16转换为10进制也不行啊(不对啊)
- 在 WindowsXP + PHP5 + Apache2 环境中连接 PostgreSQL 时错误,如何如何解决?
- SMTP发信问题~~~~~~~~~
- 如何用php写utf-8格式的文件出来?
- 有没有简便的方法建立起值为a到z的ARRAY?
- 菜鸟提问::::我想象csdn这样点web开发的php,然后右边的就出现所有的问题
- 在测试session出现这情况是什么意思?
- 我用 Header跳转网页以后,怎么得不到是从哪里跳转来的啊?
- 用<script>标签加载PHP文件,怎么获取变量值
- php telnet 问题,很慢才能取得返回值。
- 求一个复杂的时间格式转换函数
- Apache无法加载phpapache2_2.dll
select * from friend,user_user_friend where user_user_friend.user_id=6 and user_user_friend.friend_id=friend.id;
1 2 4
2 2 45
3 2 35
4 2 11
5 2 1
6 2 41
7 6 1
8 4 2
select a.fields, b.fields from a, b where a.id = b.id
然后 用户id 后边的 好友关联id 我想要的就是 好友id 的详细 信息
我想要的 是 好友的用户资料
两个表格 通过 用户的 id 先进行一次关联
能查出 这个用户的所有好友
但通过 好友 id 的关联 查出 好友的资料