我正在从数据库中返回数据,除图像外,所有数据均有效,由于某种原因,blockquote标记仅打印在第一行,我使用embed.js
返回Imgur照片和.gifs < / p>
html
<script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>
php
<h1>Fotos e gifs</h1>
<?php
include_once("config.php");
$result = mysqli_query($mysqli, "SELECT * FROM posts ORDER BY codigo DESC");
while($res = mysqli_fetch_array($result)) {
echo "<h3>".$res['titulo']."</h3>";
echo "<blockquote class='imgur-embed-pub' lang='en' data-id='".$res['link_imagem']."'></blockquote>";
echo "<hr>";
}
?>
这是正在发生的事情,我的数据库。
答案 0 :(得分:0)
我为此找到了解决方案,由于某种原因,每个脚本都支持一个blockquote,我只是在while循环中添加到script标签,如下所示:
while($res = mysqli_fetch_array($result)) {
echo "<h3>".$res['titulo']."</h3>";
echo "<blockquote class='imgur-embed-pub' data-id='".$res['link_imagem']."'></blockquote>"."<script async src='//s.imgur.com/min/embed.js' charset='utf-8'></script>";
echo "<p>".$res['conteudo']."</p>";
echo "<hr>";
}