title: One modal with different button id assign from sql
body: <p>I'm currently doing a final project for my school in online web programming but I'm having difficulties assign specific id from sql to button id, then open them with only one modal... Here's my coding:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;SICT ADMIN NEW&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="container"&gt;
  &lt;div id="admin"&gt;Admin | &lt;a href="index.php"&gt;Log Out&lt;/a&gt;&lt;/div&gt;
  &lt;ul class="topnav" id="myTopnav"&gt;
  &lt;li&gt;&lt;a href="Admin_Index.php"&gt;Home&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a class="active" href="Admin_New.php"&gt;New&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#"&gt;Update&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#"&gt;Delete&lt;/a&gt;&lt;/li&gt;
  &lt;li class="icon"&gt;
  &lt;a href="javascript:void(0);" style="font-size:15px;" onClick="myFunction()"&gt;☰&lt;/a&gt;
  &lt;/li&gt;
  &lt;/ul&gt;
  &lt;div id="content"&gt;
  &lt;div id="link_row"&gt;
  &lt;div id="link_row_1"&gt;&lt;a href="Admin_New.php" style="color:black"&gt;New&lt;/a&gt; &gt;&gt; &lt;span style="color:#900"&gt;Campus&lt;/span&gt;&lt;/div&gt;
  &lt;div id="link_row_2"&gt;
  &lt;div id="link_row_2_text"&gt;&lt;button id="Add" &gt;&lt;a href="Admin_New_Campus.php"&gt;Add&lt;/a&gt;&lt;/button&gt;&lt;/div&gt;
  &lt;div id="link_row_2_img"&gt;&lt;img src="img/add_icon.png" width="15" height="15" alt="add"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;table width="87%" align="center" border="1"&gt;
  &lt;tr&gt;
  &lt;th width="17%"&gt;Campus_ID&lt;/th&gt;
  &lt;th width="39%"&gt;Campus_Name&lt;/th&gt;
  &lt;th width="38%"&gt;Location&lt;/th&gt;
  &lt;th width="3%"&gt;&lt;/th&gt;
  &lt;th width="5%"&gt;&lt;/th&gt;
  &lt;/tr&gt;
  
  &lt;?php
  $servername = "localhost";
  $username = "root";
  $password = "mysql";
  $dbname = "SICT";
  
  //Create connection
  $con = mysqli_connect($servername, $username, $password, $dbname);
  //Check connection
  if (mysqli_connect_errno()) {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  
  $Campus_Record = mysqli_query($con, "SELECT * FROM Campus");
  while($row = mysqli_fetch_array($Campus_Record))
  {
  echo "&lt;tr&gt;";
  echo "&lt;td&gt;" . $row['Campus_ID'] . "&lt;/td&gt;";
  $Campus_ID = $row['Campus_ID'];
  $Temp = $row['Campus_ID'];
  $Edit = $row['Campus_ID'];
  echo "&lt;td&gt;" . $row['Campus_Name'] . "&lt;/td&gt;";
  echo "&lt;td&gt;" . $row['Location'] . "&lt;/td&gt;";
  echo "&lt;td&gt;&lt;button id='$Edit'&gt;Edit&lt;/button&gt;&lt;/td&gt;";
  echo "&lt;td&gt;&lt;a href='Admin_New_Campus_Delete.php?Campus_ID=$Campus_ID' onclick='return confirm(\"Confirm Delete Record?\")'&gt;&lt;button id='Campus_ID'&gt;Delete&lt;/button&gt;&lt;/a&gt;&lt;/td&gt;";
  echo "&lt;/tr&gt;";
  }
  ?&gt; 
  &lt;/table&gt;
  
  &lt;/div&gt; 
  &lt;div id="footer"&gt;© 2017 Institute ofTechnical Education. · Privacy · Terms&lt;/div&gt;
  
  
  &lt;div id="Campus_Modal" class="Modal"&gt;
  &lt;!-- Modal content --&gt;
  &lt;div class="modal-content"&gt;
  &lt;span class="Close"&gt;&amp;times;&lt;/span&gt;
  &lt;form method = "post"&gt;
  &lt;div id="Modal_Content"&gt;
    Campus ID:&lt;br&gt;
    &lt;input type="text" name="Campus_ID_2" required /&gt;&lt;br&gt;&lt;br&gt;
    Campus Name:&lt;br&gt;
    &lt;input type="text" name="Campus_Name_2" required /&gt;&lt;br&gt;&lt;br&gt;
    Location:&lt;br&gt;
    &lt;input type="text" name="Location_2" required /&gt;&lt;br&gt;&lt;br&gt;
    &lt;input type='text' id = "hidden" name="Temp" value = "&lt;?php echo $Temp; ?&gt;"&gt;
  &lt;div id="Submit"&gt;&lt;input type="submit" name="submit" value="Submit" formaction ="Admin_New_Campus_Update.php" /&gt;&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
  function myFunction() {
  var x = document.getElementById("myTopnav");
  if (x.className === "topnav") {
      x.className += " responsive";
  } else {
      x.className = "topnav";
  }
  }
  
  var modal = document.getElementById('Campus_Modal');
  var btn = document.getElementById("Edit");
  var span = document.getElementsByClassName("Close")[0];
  btn.onclick = function() {
  modal.style.display = "block";
  }
  span.onclick = function() {
  modal.style.display = "none";
  }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>