i retrieve and print data from MySQL database in json
method:
$ret = array();
$fileName = Access::FetchDB("SELECT name FROM tags");
$ret[]= $fileName;
echo json_encode($ret);
Now output is:
[[{"name":"test1"},{"name":"test2"},{"name":"test3"}]]
But i need to This output:
["test1","test2","test3"]
How do i print this?
$fileName
and put the values into$ret
.