Where is your php script too?
Anyway, check your database connection values in the php script. I tested the URL in the browser and I get access denied for the user.
Also, try and log the response from the server in the app, so that you will know how to handle it properly be it just a simple string or array or json object.
thanks for your reply this is my php code
<?
#include ("db.php");
#$host = "localhost";
#$user = "y";
#$pw = "a";
#$db = "tolu";
#$con = mysql_connect($host,$user,$pw) or die(mysql_error());
$con = mysqli_connect("localhost", "y", "a", "tolu");
// Check connection
if($con === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
mysqli_query("SET CHARACTER SET utf8");
$action = $_GET["action"];
switch ($action)
{
case "CountPersons":
# print json_encode("just yap");
$q = mysql_query("SELECT * FROM persons");
$count = mysql_num_rows($q);
print json_encode($count);
break;
Case "GetPersons":
$q = mysql_query("SELECT name, age FROM Persons");
$rows = array();
while($r = mysqli_fetch_assoc($q))
{
$rows[] = $r;
}
print json_encode($rows);
break;
case "InsertNewPerson":
$name = $_GET["name"];
$age = $_GET["age"];
$q = mysqli_query("INSERT INTO Persons (name, age) VALUES ('$name', $age)");
print json_encode("Inserted");
break;
}
?>