I have the following code in a PHP
$json=array();
if(isset($_GET["address"])){
$documento=$_GET["address"];
$conexion = mysqli_connect($hostname_localhost,$username_localhost,$password_localhost,$database_localhost);
$consulta="select subject, created from dit_ticket__cdata inner join dit_ticket on dit_ticket__cdata.ticket_id=dit_ticket.ticket_id inner join dit_user_email on dit_user_email.user_id=dit_ticket.user_id where dit_user_email.address='{$documento}'";
$resultado=mysqli_query($conexion,$consulta);
if($registro=mysqli_fetch_row($resultado)){
$result["subject"]=$registro[0];
$result["created"]=$registro[1];
$json['usuario'][]=$result;
}
mysqli_close($conexion);
echo json_encode($json);
and in Android Studio I use it like this:
public void onResponse(JSONObject response) {
JSONArray json=response.optJSONArray("usuario");
JSONObject jsonObject=null;
try {
jsonObject=json.getJSONObject(0);
System.out.println(" motivo "+jsonObject.optString("subject"));
System.out.println(" creado "+jsonObject.optString("created"));
there it shows me the first record of the 3 registered but if I add this line to the PHP file
I no longer show any record that line I only use it to show me only 1 record help please