'IN operator with 2 tables
I am try to get result from 2 tables but its done but when I use IN operator with 2 different WHERE statement its bring result from only 1 table.
May I know where I am mistake?
$search_Query = "SELECT * FROM `sys1`,`sys2` WHERE sys1.id_1 IN (705,1,7,706,707) AND sys2.id_2 IN (705,1,7,706,707)";
$search_Result = mysqli_query($conn, $search_Query);
if($search_Result){
if(mysqli_num_rows($search_Result)){
while($row = mysqli_fetch_array($search_Result)){
$finddown = $row['display_name']; //from sys1.id_1
$stream_status = $row['status']; // from sys2.id_2
echo $finddown. " = " . $cstatus;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
