I am not sure why, it gave me this error, and my session_start(); is already at the first line. The codes work before, but i altered the sql query, then it gave me that error.
Here is my code.
<?php
ini_set('display_errors', 1); error_reporting(E_ALL);
session_start();
include 'connect.php';
$_SESSION['username'];
$_SESSION['id'];
$userid = $_SESSION['id'];
//Using session username to pull out variables from Table
$result=mysqli_query($con,"SELECT ......);
while ($row1 = mysqli_fetch_assoc($result))
        {
   $output[] = $row1;
        }
        if (!empty($output)){
        echo json_encode( $output );}
        else{
            echo json_encode( [] );
        }
?> 
 
     
     
     
    