在php脚本和dygraphs中使用新的date()

I'm trying to retreive data from a mysql then transfert my data to dygraphs

So what working directly in javascript

 new Dygraph(document.getElementById("graphdiv2"),
          [

[ new Date("2009/07/12"), 100, 200 ],
[ new Date("2009/07/19"), 150, 220 ]
          ],
          {
            labels: [ "x", "A", "B" ]
          });

And what is not working with usage of php to retreive value from data base :

new Dygraph(document.getElementById("graphdiv"),
          [ 

            <?php
            mysql_connect("xxx.xxx.xxx.xxx", "MyUser", "MyPassword") or
            die("Impossible de se connecter : " . mysql_error());
            mysql_select_db("esync");


            $result = mysql_query("SELECT ID, _date, ESYNC_TAGSHISTORY.Val
            FROM ESYNC_TAGSHISTORY
            INNER JOIN ESYNC_TAGS ON ESYNC_TAGSHISTORY.TAGID=ESYNC_TAGS.ID
            WHERE ESYNC_TAGS.NAME='I_TT_21052'  AND ESYNC_TAGS.STATIONID=1 AND (_date BETWEEN now()-INTERVAL 45 MINUTE AND now());");

            $return_arr = array();

            //while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
            $numResults = mysql_num_rows($result);  

            $counter = 0;           

            while ($row = mysql_fetch_array($result)) {

                $date = date_create($row['_date']);
                $date = $date->format('d/m/y H:i:s');   //format the date
                $b=$row['Val'];


            echo "[".$date.",".$b."],";


            };

            ?>  

Thanks :)

Finally, i've loaded my data with CSV format as

while ($row = mysqli_fetch_array($result)) {


                $a= date('Y/m/d H:i:s',strtotime($row['_date']));  //converting into required format of date



                $b=$row['Val'];

                if (++$counter == $numResults) {
                echo  '"'.$a.",".$b.'"'." ,";
                } else {
                echo  '"'.$a.",".$b.'
"'." +". "
";
                }



            };