0
我試圖用PHP列出來自MySQL的blob,但圖像沒有顯示。我檢查了源頁面,源頁面結果如下。如何使用PHP從MySQL列出blob文件?
data-url="<?php echo $eachImage; ?>"
& data-thumbnail-path="<?php echo $eachImage; ?>"
這裏我期待着路徑。在查看源頁面中,本節將顯示一些編寫的數據。
如何從blob文件獲取圖像路徑?
<?php foreach ($this->carousel as $carousel): ?>
<?php
if ($carousel['title'] == 'service') {
$rs = Database::getInstance()
->query("SELECT * FROM tl_carousel WHERE title = 'service' ");
$result = $rs->fetchAllAssoc();
$images = deserialize($carousel['themesSRC']);
foreach ($images as $eachImage)
{
?>
<ul>
<li data-url="<?php echo $eachImage; ?>" data-width="800" data-height="500"></li>
<li data-thumbnail-path="<?php echo $eachImage; ?>"></li>
<li data-thumbnail-text="" data-thumbnail-text-title-offset="43" data-thumbnail-text-offset-top="16" data-thumbnail-text-offset-bottom="7">
<!-- <p class="largeLabel">CUSTOM TEXT CAN BE ADDED HERE</p> -->
<p class="smallLabel"><?php echo $carousel['title']; ?></p>
</li>
<li data-info="">
<!-- <p class="mediaDescriptionHeader">CUSTOM TEXT CAN BE ADDED HERE AND FORMATTED WITH CSS</p> -->
<p class="mediaDescriptionText"><?php echo $carousel['title']; ?></p>
</li>
</ul>
<?php
}
}
?>
<?php endforeach; ?>
查看源結果