Skip to content
Advertisement

Ajax request from PHP don’t return me an Array

I’m trying to return an array from a PHP script in Ajax, however, it seems to not work, it returns me a string rather an Array. I’m using CodeIgniter Framework, there is my .php code :

And there is my Ajax request :

My getAll() function just select all from the database, however i’m only using the temperature & date column.

It should return me an Array like this one, But rather it returns me this.

Can you please help me or give me some clue of what is going on ?

Yours sincerely,.

Advertisement

Answer

You need to parse the JSON in Javascript:

and it should work.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement