el php
<?php
$con=mysql_connect("localhost","root");
$db=mysql_select_db("persons", $con);
$q = mysql_query("SELECT * FROM persons");
$count = mysql_num_rows($q);
print json_encode($count);
?>
le quite $get etc. para mas fácil prueba
*** código de test.b4a ( ejemplo web anywhere )
Sub Globals
Private PersonsListview As ListView
Private CountPersonsButton As Button
Private GetPersonsButton As Button
Private NameET As EditText
Private AgeET As EditText
Private InsertNewPersonButton As Button
Private Label1 As Label
Private Label2 As Label
Private ServerIP As String
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
ServerIP="192.168.1.50:3306" ' The ip address where you Xampp installation runs
'ServerIP="127.0.0.1:8000" ' The ip address where you Xampp installation runs
///// Con cualquier valo serverip falla ////
End Sub
Sub CountPersonsButton_Click
Dim CountPersons As HttpJob
CountPersons.Initialize("CountP", Me)
CountPersons.download2("http://" & ServerIP & "/persons/persons.php", Array As String ("action", "CountPersons"))
'CountPersons.download2("
http://localhost/persons/persons.php", Array As String ("action", "CountPersons"))
End Sub
/// quite el resto de código para mayor claridad ///
**