[英]How to select two rows from one table?
I would like to use mysql_query
to select two rows from one table with the usage of pid twice.我想使用
mysql_query
从一个表中选择两行,同时使用pid两次。
Like this:像这样:
<?php $result = mysql_query("SELECT * FROM posts WHERE pid='$user1' AND pid='$user2' order by id desc limit 50") ?>
Is this possible?这可能吗?
Try this..尝试这个..
SELECT * FROM posts WHERE pid='$user1' OR pid='$user2' order by id desc limit 50
Hope this helps.希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.