please help me im new in programming
I am trying to disable specific dates in datepicker based from dates in my database using while ($row = mysql_fetch_array($query))
here is the code:
<?php include"pages/config.php";
$query=mysql_query("SELECT * FROM request");
while ($row = mysql_fetch_array($query)) {
$dbDate = $row['event_date'];
}
?>
var disabledDays = ["10-21-2014", "11-15-2014", "11-17-2014"];
function disableAllTheseDays(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) {
return [false];
}
}
return [true];
}
$(function () {
$("#dp").datepicker({
minDate: 0,
dateFormat: 'mm/dd/yy',
inline: true,
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
beforeShowDay: disableAllTheseDays,
});
});
</script>
I wanna change the dates "10-21-2014", "11-15-2014", "11-17-2014" to all the dates that $dbDate had gotten during the loop.
How can i do that?