在 PHP 中显示数据库中的 Youtube 视频

我发现我的代码中出现了奇怪的情况。我在 PHP 页面上显示数据库中的 YouTube 视频。我将 YouTube 视频 ID 保存在我的数据库中。所有 YouTube 视频都运行良好,除了一个 ( https://www.youtube.com/watch?v=_oFsdDHuhQQ&feature=youtu.be ) 该视频未在我的代码上运行。我检查了这个在 WordPress 上运行的视频,但没有以这种方法运行。我不知道为什么会发生这种情况,也许视频 ID 是从“_”(下划线)开始的,有人可以帮忙吗?


<div class="row">

            <?php

                $video_query="select * FROM care_class_topic_file_upload WHERE care_topic_id='$_GET[care_topic_id]' AND care_class_topic_file_type=1";

                $video_result= mysqli_query($con,$video_query);

                 while($row_video = mysqli_fetch_assoc($video_result))

                 {

                ?>

            <div class="col-6 col-sm-3 col-md-4" style="padding:10px;">

                <div class="embed-responsive embed-responsive-16by9">

                  <?$page="https://www.youtube.com/embed/$row_video[care_class_topic_file_video_url]";?>

                    <iframe class="embed-responsive-item" src=<? echo $page; ?> frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

                </div>

            </div>

        

            <?php

                 }

            ?>

            

        </div>


互换的青春
浏览 68回答 0
0回答
打开App,查看更多内容
随时随地看视频慕课网APP