试图将一个查询的结果放入WHERE
另一个查询的语句中:
$query1 = "SELECT DISTINCT company_id FROM location WHERE state = 'XX'";
$result1 = mysql_query($query1) or die(mysql_error());
while($row1 = mysql_fetch_array($result1)) {
//Collect WHERE STATEMENT HERE
}
我尝试了以下方法:
$q1 = "SELECT company FROM company WHERE id = '16', id = '7' ORDER BY company";
$q1 = "SELECT company FROM company WHERE id = '16' AND id = '7' ORDER BY company";
$q1 = "SELECT company FROM company WHERE id = '16' && id = '7' ORDER BY company";
连同其他变体
WHERE AND
如果使用不同的表名,谷歌搜索只提供了多个,但不一样。有人有任何指示吗?