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

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -