title: Using JQuery auto complete with php/mysql not working
body: <p>I am trying to use a code that was flagged as working and I am not getting any results, it's just empty. Notes: The MySQL does return results if run alone, so it's not an sql thing. Any suggestions?</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;head&gt;
          &lt;title&gt;TODO supply a title&lt;/title&gt;
          &lt;meta charset="UTF-8"&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
          &lt;link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"&gt;       
          &lt;script src="https://code.jquery.com/jquery-1.12.4.js"&gt;&lt;/script&gt;
          &lt;script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
          Name: &lt;input id="hint" /&gt;
  
          &lt;script type="text/javascript"&gt;
  
              $("#hint").autocomplete({
                  source: function (request, response) {
                      $.ajax({
                          url: "getMedicineNames.php",
                          dataType: "jsonp",
                          data: {
                              name: request
                          },
                          success: function (data) {
                              response(data);
                          }
                      });
                  },
                  minLength: 3
              });
  
          &lt;/script&gt;
      &lt;/body&gt;
  </code></pre>
  
  <p><strong>PHP:</strong></p>
  
  <pre><code>require 'connect.inc.php';
  $mysql = mysqli_connect("$db_host", "$db_username", "$db_pass", "$db_name");
  $name = $_POST['name'];
  if ($name != "") {
  
      $sql = "SELECT MedicineName FROM medicinetypes WHERE MedicineNAme LIKE '%$name%'";
      echo json_encode(mysqli_fetch_all(mysqli_query($mysql, $sql), MYSQLI_ASSOC));
  }
  </code></pre>