Arrays of arrays or arrays of object ?
Arrays of arrays or arrays of object ?
![Arden54](https://secure.gravatar.com/avatar/e0a3f5ac44283d6315d5d9ec74764532/?default=https%3A%2F%2Fvanillicon.com%2Fe0a3f5ac44283d6315d5d9ec74764532_200.png&rating=g&size=120)
Hi,
I'm trying to display datatables with data from my database. The json response looks like this :
{"data":[["pineapple","1","1","1",null,"09\/Jan\/18"],["tomato","2","1","2",null,"31\/Jan\/11"],["banana","3","2","1","test","01\/Jan\/20"]]}
Is that an arrays of arrays or arrays of object ? If it is an array of arrays, can you affirm that I don't have to put "columns" : [column names]
please ?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @Arden54 ,
Yep, the square brackets mean it's an array of arrays, so yep, you don't need to specify the
columns
. See the example here, on the Ajax tab, this data is like yours.Cheers,
Colin
Hi, thanks for answer ! I just have a little question, where do you put the directory "data" ? I'm on Symfony3. I tried to put it in the web directory but it seems not to be recognized![:( :(](https://datatables.net/forums/resources/emoji/frowning.png)
Nevermind, as I'm using a function to get data from my DB I'm not gonna use the "data/arrays.txt". Thanks anyway for the answer![;) ;)](https://datatables.net/forums/resources/emoji/wink.png)
Guessing you have two accounts (Nancy/Arden)![:) :)](https://datatables.net/forums/resources/emoji/smile.png)
Right, I had a problem with my first account that's why I created a second but there is no more problems now that's why I have 2 ^^