Hi all,
I wanted to fetch the title of an image which is saved in a mysql Db, I found out that you have to do this through Json, right now I am having a .php file:
It outputs as follows:
But now I am stuck, I want to put these titles in a simple arraylist but i don't know how to make the connection between the outputted data and the arraylist itself.
Is it possible to do this on an easy way?
Thanks.
I wanted to fetch the title of an image which is saved in a mysql Db, I found out that you have to do this through Json, right now I am having a .php file:
PHP:
<?php
mysql_connect("localhost","xx","xx");
mysql_select_db("xx");
$q=mysql_query("SELECT title FROM field_title");
while($e=mysql_fetch_assoc($q))
$output[]=$e;
print(json_encode($output));
mysql_close();
?>
It outputs as follows:
Code:
[{"title":"titleone"},{"title":"titletwo"},{"title":"titlethree"}]
But now I am stuck, I want to put these titles in a simple arraylist but i don't know how to make the connection between the outputted data and the arraylist itself.
Code:
ArrayList<String> list = new ArrayList<String>();
for (??) {
list.add(string);
}
Is it possible to do this on an easy way?
Thanks.
.