mysql - how can i use variable table $r1 in the query $r2 instead of table name on FROM clause in php file -
$r1 = mysqli_query($con,"select course_id,status attendance stud_id = '$stud_id'"); $r2 = mysqli_query($con,"select course_name,status **$r1** natural join course stud_id = '$stud_id'");
you may have use subquery this.
$r2 = mysqli_query($con,"select course_name,status (select course_id,status attendance stud_id = '$stud_id') natural join course stud_id = '$stud_id'");
Comments
Post a Comment