<?php
include '../../conn.php';

$userid=$_GET['userid'];

$resultdata =$con->query("select * from `myAnimal` where userId='$userid' ");
$id=null;
$name=null;
$adminbyname=null;
$email=null;
$result=array();
   while($row=mysqli_fetch_array($resultdata))
    {
     
 array_push($result,
        array(
            'id' => $row['id'],
            'name' => $row['name'],
            'animalid' => $row['animalId']
        	));
    }

echo json_encode(array("result"=>$result));
    
    


   
?>