gpt4 book ai didi

phpmyadmin blob php image out encrypted, 想在网页上显示blob图片

转载 作者:行者123 更新时间:2023-11-28 15:27:34 25 4
gpt4 key购买 nike

问题出在这里:

代码是加密的,所以我无法在网页上显示 blob 图像,我希望 blob 显示为图像:

<?php
//connect to server
$connect = mysql_connect("localhost","root","");

//connect to database
mysql_select_db("website");

//query the database
$query = mysql_query("SELECT * FROM homepage");

//fetch results of database and convert to an array

while($rows = mysql_fetch_array($query)):
//

echo "<div class = 'productBox1'>";
echo "<img class = 'pImg1' src='{$rows['image']}' />";
echo "<div class = 'pDesk1'>" . "<p>" . $rows['description'] . "</p>" . "</div>";
echo "</div>";
//
endwhile;

?>

最佳答案

尝试将其插入到您的 php 代码中

$rows['image'] = base64_decode($rows['image']);

编辑:确保您使用

将图像放入数据库
$image = base64_encode($image);

关于phpmyadmin blob php image out encrypted, 想在网页上显示blob图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24945759/

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