Javascript, Mysqli, and PHP Looping -
i working on site, , having create php loop javascript in it. possible? here snippet of code 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 work trying accomplish? gives me error, don't know wrong code. help!
you appear building json output javascript object of data.
this better achieved following.
<?php $calendar = mysqli_fetch_array($client_get_calendar); echo json_encode($calendar); ?>
modify array in loop.
Comments
Post a Comment