when i am using url:“data.php”; < actually tested it independently by using “echo json_encode($myjsonarray);” > nothing is coming in dtable view.
json string is correctly created…
Do I need to add some connectors/config file
Please someone give some clear view on this.
/* this is the response, that you posted, wrong pattern.
* this looks like you had an array on the first level
* and each element of that array looks like an array with on object (wrong)
*/
[
[{
"id":"1",
"menu_name":"Frontdesk"
}],
[{
"id":"2",
"menu_name":"Booking"
}],
[{
"id":"3",
"menu_name":"Membership"
}],
[{
"id":"4",
"menu_name":"Academics"
}]
]
/* this is the pattern that you need.
* object on the first level with a "data" property.
* data is supposed to be an array of objects (not an array of arrays)
*/
{
"data": [{
"id":"1",
"menu_name":"Frontdesk"
},{
"id":"2",
"menu_name":"Booking"
},{
"id":"3",
"menu_name":"Membership"
},{
"id":"4",
"menu_name":"Academics"
}]
}
I want to access a table from MySQL Database.
My JSON string is creating which I am able to see if i directly load it ( i.e. http://localhost/mywebixapp/data.php ) using echo json_encode($myjsonstring); but when I replace echo with return and use the mytableview.php file to load the data.php using url:data.php then it’s not showing me data.