title: Return value from SQL as button name, display text after clicking the button
body: <p>I am doing a project that uses php and MySQL. I am really new to php and I have searched a lot but still haven't found a clean solution.</p>
  
  <p>The problem is, firstly user inputs key words and it returns searched values(table names) to variables.  </p>
  
  <pre><code>echo '&lt;h2&gt; Search Result: &lt;/h2&gt;';
  $searchSQL = "select distinct table_name from information_schema.columns where lower(column_name) like lower('%$search%') and table_schema='university'";
  $result = $conn-&gt;query($searchSQL);
  if ($result-&gt;num_rows &gt; 0) {
     // output data of each row
     while($row = $result-&gt;fetch_assoc()) {
     $table_name = $row['table_name'];
     echo "&lt;input type='submit' name=$table_name value=$table_name&gt;"."&lt;br /&gt;";
   }
  </code></pre>
  
  <p>Now the buttons are created. If user clicks on any button,it should go further and return the column names of each table. I don't know how to do with non-static buttons.</p>