<?php
    require_once 'data.php';
    $data_img = array();
    // Results
    $draw1 = "SELECT * FROM content_img";
    $qdraw1 = mysqli_query($data, $draw1);
    
    if(mysqli_num_rows($qdraw1) > 0) {
        while($fdraw1 = mysqli_fetch_assoc($qdraw1)) {

            $data_img[] = array(
                'token' => $fdraw1['id'],
                'images' => $fdraw1['contents_img'],
                'desc' => $fdraw1['content_desc']
           );
        }
            
    }


     header('Content-Type: application/json');
     header('Content-Type: application/json');
     header('Content-Type: application/json');
    header("Access-Control-Allow-Origin: *"); // Replace with your Next.js app's origin
    header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
    header("Access-Control-Allow-Methods: GET");
     echo json_encode($data_img)

?>