<?php
    require_once('conn.php');
    $q2="select * from coins where 1";   
$r = mysqli_query($con,$q2);
$data = [];
while($c = mysqli_fetch_assoc($r)){
     array_push($data,$c);
}

    print_r(json_encode($data));

?>