title: How to disable certain days of the week on a jQuery datepicker based on a result in a database with PHP
body: <p>I have a <strong>mySQL</strong> database with a table of staff information and what days of the week they work i.e Tuesday, Wednesday, Friday.</p>
  
  <p>I have an <strong>HTML</strong> from which allows user to book an appoint, the idea is based on who they want the <strong>appointment</strong> with would depend what days they can chose from within the <strong>jquery</strong> datepicker.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;form action="" method="post"&gt;
       &lt;input type="text" id="Name" name="Name" required="required" value="Name"&gt;
       &lt;select id="SelectStylest" name="stylest"&gt;
  
  `&lt;?php 
  
       $sql = mysqli_query($con, "SELECT Name FROM staff") or die(mysqli_error());
  
        while ($row = $sql-&gt;fetch_assoc()){
  
          echo "&lt;option value='".$row['Name']."'&gt;".$row['Name']."&lt;/option&gt;";
  
        }
  
      ?&gt;
      &lt;/select&gt;
  
      &lt;input type="text" name="appointment_date"id="datepicker"&gt;
  
      &lt;input type="submit" name="submit" id="submit" value="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>          
            $( function() {
              $( "#datepicker" ).datepicker();
               $('input.timepicker').timepicker({
                  minTime: "09:00",
                  maxTime: "17:00"
                 
               });
              });
             
      </code></pre>
  </div>
  </div>
  </p>
  
  <p>I know I need to following query to search the database to friend the name of the stylist, but after that I get lost. I have googled the problem but haven't found anything on the subject.</p>
  
  <pre><code>$stylest = $_POST['stylest'];
  
      $query = mysqli_query($con,"SELECT * FROM staff WHERE Name LIKE '%$stylest%'"); 
  </code></pre>