<?php

header("Access-Control-Allow-Origin: *");
//$data=array('8ndhidEmUbI', 'NVLVZzfJXiA', 'XBIRnU4YCVY', 'fkxsiKCnL_A');
require 'database.php';
$cat = $_GET['category_id'];

$result = mysqli_query($con,"SELECT * FROM videos v RIGHT join category c on c.cat_id = v.video_cat join company cm on cm.com_id = c.com_id WHERE video_cat='$cat'");
while( $row = mysqli_fetch_assoc( $result)){
    $new_array[] = $row; // Inside while loop
}


mysqli_close($con);

echo json_encode($new_array);


   
?>