I am working on a site, and I am having to create a PHP loop with Javascript in it. Is this possible? Here is the snippet of code I need looped.
<? while($calendar = mysqli_fetch_array($client_get_calendar)) { ?>
{
title: '<? echo $calendar['event_title'] ?>',
start: new Date(<? echo date("Y", strtotime($calendar['date_start'])) ?>, <? echo date("m", strtotime($calendar['date_start'])) ?>, <? echo date("d", strtotime($calendar['date_start'])) ?>),
end: new Date(<? echo date("Y", strtotime($calendar['date_end'])) ?>, <? echo date("m", strtotime($calendar['date_end'])) ?>, <? echo date("d", strtotime($calendar['date_end'])) ?>),
className: '<? echo $calendar['importance'] ?>'
},
<? } ?>
Will this work for what I am trying to accomplish? It gives me an error, but I don't know what is wrong with the code. Thanks for any help!