0

Im new to Php and want to make ajax call to Php file, Php file contains the sql query like below.

"SELECT count(*) as noOfReg, UNIX_TIMESTAMP(register_on) as register_on FROM `XXXXX'    GROUP BY current_status, date(register_on)"

it will give two values (noOfReg,register_on). i want to send array to ajax success like below , because i want to use it in charts.

[
    [register_on,noOfReg],
    [register_on,noOfReg],
    [register_on,noOfReg],
    [register_on,noOfReg]
]

Note:(register_on)--->typically date.

sharief
  • 59
  • 7
  • convert the response to array and then json_encode it – Cerlin Feb 12 '16 at 06:16
  • 1
    @Cerlin Boss ,Yes it worked "convert the response to array and then json_encode it" thank u Cerlin. – sharief Feb 12 '16 at 06:45
  • Something like this , if any one wants $a = array((int)$row['register_on'],(int)$row['noofregistraitons']); echo json_encode($a); – sharief Feb 12 '16 at 06:47

1 Answers1

0
Community
  • 1
  • 1
Hashir Hussain
  • 614
  • 4
  • 8
  • 27