I have a date picker that inserts into a datebase a number of days in one column so for example:

datearriving would have: 11-8-2012, 12-08-2012, 12-8-2012


What im struggling with is calling the values from the database to grey out the days in my form. Any ideas???

PHP Code:

var disabledDays = [

<?php while ($row mysql_fetch_array($greyMYSQL_ASSOC)) {
   echo 
'"' $row['datearriving'] . '",';  
}
?>
];


/* utility functions */
function nationalLeavingDays(date) {
  var m = date.getMonth(), d = date.getDate(), y = date.getFullYear();
  for (i = 0; i < disabledDays.length; i++) {
    if($.inArray((m+1) + '-' + d + '-' + y,disabledDays) != -1 || new Date() > date) {
      return [false];
    }
  }
  return [true];
}
function noWeekendsOrLeavingHolidays(date) {
  
  return nationalLeavingDays(date);
}


/* create datepicker */
jQuery(document).ready(function() {
    
    function displayVals() {     
        var numdays = $("#num_days").val();
        jQuery('#datepicker').multiDatesPicker({
            mode: 'daysRange',
            autoselectRange: [0,numdays]
            
            
        });
        
    }   
    $("#num_days").change(displayVals);    
    displayVals();
});


Thanks