我无法在php mysql中搜索树
表结构我无法在php mysql中搜索树,php,mysql,Php,Mysql,表结构 userID SponserID 102 200 201 102 202 102 203 201 所有用户都有parend id表示赞助商id 如何找到102用户的所有记录 请帮助我使用这些查询: 用于获取userID 102的所有记录 从userID=102的tablename中选择* 用于获取父级为102的所有记录 从表名中选择*,其中SponserID=102 如果您有一个真正的嵌套树,并且对查找特定
userID SponserID
102 200
201 102
202 102
203 201
所有用户都有parend id表示赞助商id
如何找到102用户的所有记录 请帮助我使用这些查询:
- 用于获取userID 102的所有记录
从userID=102的tablename中选择*
- 用于获取父级为102的所有记录
从表名中选择*,其中SponserID=102