<?php
require_once __DIR__ . '/../../connect.php';

$sql = "SELECT * FROM `videos`";
$stmt = $con->prepare($sql);
$stmt->execute();
$data = $stmt->fetchAll(PDO::FETCH_ASSOC);

if ($data) {
    jsonSuccess($data);
} else {
    jsonError("No video records found");
}
?>