Trying to display MySQL data in my domain server to android app using PHP and displaying my data as a toast message. Whenever I run the app, I get empty toast. Further, I will be using a list view to display the data. There are no errors in the code. Below is the code for my AsychTask:
class Connection extends AsyncTask<String, String, String> {
        @Override
        protected String doInBackground(String... params) {
            String result = "";
            String host = "http://prasaurus.com/conn.php";
            try {
                HttpClient client = new DefaultHttpClient();
                HttpGet request = new HttpGet();
                request.setURI(new URI(host));
                HttpResponse response = client.execute(request);
                BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
                StringBuffer stringBuffer = new StringBuffer("");
                String line = "";
                while ((line = reader.readLine()) != null ){
                    stringBuffer.append(line);
                    break;
                }
                reader.close();
                result = stringBuffer.toString();
            } catch (URISyntaxException e) {
                e.printStackTrace();
            } catch (ClientProtocolException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return null;
        }
        @Override
        protected void onPostExecute(String result){
            Toast.makeText(getApplicationContext(),result,Toast.LENGTH_SHORT).show();
        }
    }
Here is my php code on sever end:
<?php
$db_name = "prasauru_FAND_DB";
$mysql_username = "###########"; #database name on server end
$mysql_password = "###########"; #database password
$server_name = "prasaurus.com"; 
$conn = mysqli_connect($server_name, $mysql_username, $mysql_password, $db_name);
if(!$conn){
    die("Error in connection"  . mysqli_connect_error());
}
$response = array();
$query = "SELECT * FROM `under8_club_league` ORDER BY `points` DESC";
$result = mysqli_query($conn, $query);
if(mysqli_num_rows($result) > 0){
    while ($row = mysqli_fetch_assoc($result)){
        array_push($response , $row);
    }
}
else {
    $response['success'] = 0;
    $response['message'] = 'No data';
}
echo json_encode($response);    
mysqli_close($conn);
?>
 
     
    