
<?php
$host='localhost';
$user='amr123';
$password='AMRdahes03250@';
$dbname='amraccountant';
$conn = new mysqli($host, $user, $password, $dbname);
$conn->set_charset("utf8");
 
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
$sql = "select * from coursev1";
$response= array(); 

$stmt = $conn->prepare($sql);
$stmt->execute();

$stmt->bind_result($id ,$vediouri ,$title,$channelname,$timevedio);
 
while($stmt->fetch()){
 
 $post = [
  'id'=>$id,
 'vediouri'=>$vediouri,
 'title'=>$title,
 'channelname'=>$channelname,
 'timevedio'=>$timevedio,
 ];
 
 array_push($response, $post);
}

echo json_encode(array("vedio"=>$response),JSON_UNESCAPED_UNICODE);


?>