gpt4 book ai didi

php - 显示存储在 mySQL 中的 youTube iframe

转载 作者:行者123 更新时间:2023-11-30 01:24:03 25 4
gpt4 key购买 nike

我正在尝试在页面上显示 youTube 视频。代码存储在 mySQL 数据库中。

说到这,我真是个傻瓜。如果有人要求我就更改代码做出明智的决定,我将不知道该怎么做。我基本上是复制粘贴类型,所以如果有人能给我一个正确的代码,我将非常感激。我确信这个缺陷像公牛一样大,但是嘿,我在这方面有点短视!

我正在使用这个代码。我没有收到错误消息或任何与此相关的信息。只是一个空白页。

谢谢!!

尤金妮

这是我正在使用的代码:

<?php

$DBhost = "localhost";
$DBuser = "----";
$DBpass = "----";
$DBName = "----";
$table = "----";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");

@mysql_select_db("$DBName") or die("Unable to select database $DBName");

$results = mysql_query($sqlquery);


$clip1 = $row["clip1"];
$clip2 = $row["clip2"];
$clip3 = $row["clip3"];
$clip4 = $row["clip4"];


echo "<iframe src=\"{$clip1}\" style=\"background: #fff;\" frameborder=\"0\" height=\"300\" scrolling=\"auto\" width=\"480\"></iframe>";
echo "<iframe src=\"{$clip2}\" style=\"background: #fff;\" frameborder=\"0\" height=\"300\" scrolling=\"auto\" width=\"480\"></iframe>";
echo "<iframe src=\"{$clip3}\" style=\"background: #fff;\" frameborder=\"0\" height=\"300\" scrolling=\"auto\" width=\"480\"></iframe>";
echo "<iframe src=\"{$clip4}\" style=\"background: #fff;\" frameborder=\"0\" height=\"300\" scrolling=\"auto\" width=\"480\"></iframe>";

?>

最佳答案

定义处理结果集的正确方法

第1步:定义sql查询


$sqlquery="select * from some_table";

第 2 步:运行查询


$results = mysql_query($sqlquery);

第3步:检索结果


while($row=mysql_fetch_array($results,MYSQL_ASSOC)){
echo "";
}

关于php - 显示存储在 mySQL 中的 youTube iframe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18210569/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com