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

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -