如何加入?
query = "SELECT * FROM users AS first JOIN users AS second
ON first.imguploaded = second.imguploaded
WHERE first.userid = $user1 AND second.userid = $user2"
This query would take the two users, and if they have the same attribute (imguploaded is the same for both), return both rows, you can then select what you need. You can add more attributes to the ON clause, for example:
ON first.imguploaded = second.imguploaded OR ( first.imgdloaded = second.imgdloaded AND first.somethingelseuploaded = second.somethingelseuploaded).
这样(加上我方言中的“ ON”条款),你就可以将一切属性合并起来,但你必须把括号(和)放在适当的位置。 当然,如果你不提,MySQL服务器将只是按序读。
这是你们需要的吗?