title: phpmyadmin select data from multiple tables using php
body: <p>hello i am trying to do a select query from multiple tables and I made variables for the tables names and it works if I removed the variables and put the tables names instead what to do?</p>
  <pre><code>$table_name = $wpdb-&gt;prefix . 'student_list';
   $table_name1 = $wpdb-&gt;prefix . 'courses';
   $table_name2 = $wpdb-&gt;prefix . 'registration';  
  
  
  
  $registrations = $wpdb-&gt;get_results(&quot;SELECT registration_id , $table_name1.course_id ,$table_name.student_id ,$table_name1.name, $table_name1.course_name ,$table_name1.course_code FROM $table_name ,$table_name1, $table_name2 WHERE $table_name2.course_id = $table_name1.course_id and $table_name2.student_id = $table_name.student_id&quot;);
  </code></pre>