php - Why is my code not retrieving the data in a graph? -


<?php      session_start();     include "../../lib/mssql.connect.php";      $params = array($_post['year'], sha1($_post['month']));     $sql ="select count(*) totalguestbook_totalcount, month(guestbook_createddate) mth tbl_guestbook            year(guestbook_createddate) ='2015'            group month(guestbook_createddate)";       // run query     $result = sqlsrv_query($conn, $sql, $params)          while($row = sqlsrv_fetch_array( $result, sqlsrv_fetch_assoc))         {             $dashboardresult[] = array('label' =>$row['guestbook_createddate'], 'values' =>$row['totalguestbook_totalcount']);         }     echo json_encode($dashboardresult); ?> 

do not include $params in query execution use:

$result = sqlsrv_query($conn, $sql); 

instead of :

$result = sqlsrv_query($conn, $sql, $params) 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -