Compare two tables Show only matching data records

Description

mysql php compare two tables columns to find matched records 

sql query for retrieving matched, mysql Show Matching data columns in two tables

Step By Step mysql compare two tables to find matched records in php

 

duplicates data in tables columns and compare another tables get match data

Show step by step

 

      <?php

$showst=mysql_query("Select DISTINCT managebatchid from managebatchtimeadd"); 

while($rowlinkst=mysql_fetch_array($showst)){

$rowlinkstbtid = $rowlinkst['managebatchid'];

 

$showstbt = mysql_query("Select * from batchlistshowtime where id = '$rowlinkstbtid' ORDER BY id DESC"); 

$rowlinkstbt = mysql_fetch_array($showstbt) ;

$rowlinkstbtltmt = $rowlinkstbt['batchname']; 

echo $rowlinkstbtltmt;

echo "<br>";

} ?> 

 

another method is used LEFT JOIN 

 

Comparing two tables to find matching column 

The shortest, fastest, and easiest way to compare two tables

Comparing 2 Tables in MySQL php