title: How to code my MySQL data into Bootstrap input tags with autocomplete?
body: <p>I'm creating this bootstrap input tag in my project using PHP.</p>
  
  <p>Now, how can I populate the <code>restrictTo</code> and <code>suggestions</code> with data from MySQL?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;title&gt;Send Memorandum&lt;/title&gt;
      &lt;!-- Bootstrap --&gt;
      &lt;link href="css/bootstrap.min.css" rel="stylesheet"&gt;
      &lt;link href="css/memo.css" rel="stylesheet"&gt;
      &lt;link href="css/bootstrap-tags.css" rel="stylesheet"&gt;
      &lt;script src="js/jquery.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;form enctype="multipart/form-data" action="send.php" method="post" class="memo" style="padding-top:10px"&gt;
      &lt;div class="form-group row"&gt;
          &lt;div class="col-xs-8"&gt;
              &lt;label for="To" style="padding-top: 10px;" &gt;To: &lt;/label&gt;&lt;br&gt;
              &lt;p&gt;suggestOnClick&lt;/p&gt;
              &lt;div id="suggestOnClick"&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  
  &lt;script src="js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/bootstrap-tags.min.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>In this section i want to make the default value of the suggestions: to be removed and then replace it with my MySQL data values like "SELECT account_username FROM tbaccounts" into the suggestion: and restrictTo: Is that possible? </p>
  
  <p>So this is my SCRIPT</p>
  
  <pre><code>&lt;script&gt;
  $(function(){
      $("#suggestOnClick").tags({
          restrictTo: ["alpha", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel", "india"],
          suggestions: ["alpha", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel", "india"],
          promptText: "Click here to add new tags",
          suggestOnClick: true
      });
  });
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is my PHP</p>
  
  
  
  <pre><code>&lt;?php
  //fetch.php
  $connect = mysqli_connect("localhost", "root", "", "fullcalendar");
  $query = "
   SELECT * FROM tbaccounts ORDER BY account_username
  ";
  
  $result = mysqli_query($connect, $query);
  
  $data = array();
  
  if(mysqli_num_rows($result) &gt; 0)
  {
   while($row = mysqli_fetch_assoc($result))
   {
    $data[] = $row["account_username"];
   }
   echo json_encode($data);
  }
  
  ?&gt;
  </code></pre>
  
  <p>Now, How can i put this json_enccode($data); to restricTo: and suggstions: in the SuggestOnClick Funtion?</p>