我想比较2个不同表中的相同值并计数

时间:2019-05-04 10:21:50

标签: php mysql

这是我的代码,我要解决这个问题?

$id = $_GET['id'];

$sql = "SELECT 
        ques.Correct_Option,
        user_ans.std_ans 
    FROM ques  
    LEFT JOIN user_ans 
        ON ques.Correct_Option = ques.Correct_Option 
    WHERE 
         ques.id=$id ;";

$result = mysqli_query($con,$sql);
$count2 = mysqli_num_rows($result);
$data   = mysqli_fetch_array($result);

echo $count2;

0 个答案:

没有答案