我将文章数据存储在文章表中,“图像”列具有 blob 数据类型
我有我的PHP代码:
$sql = "SELECT * FROM `articles`
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
// output data of each row
while ($row = mysqli_fetch_assoc($result)) {
$image = $row['image'];
$head = $row['head'];
$content = $row['content'];
$createdBy = $row['createdBy'];
$date = $row['date'];
}
}
我有元标签:
<meta property='og:image' content="<?php echo $iamge ?>"/>
我期待我的元标记源代码为:
<meta property='og:image' content="image_source"/>
注意:在“img”标签的src属性中我得到了图片并成功显示。但是在“元”标签的内容属性中我没有得到图像源。
但我得到:
<meta property='og:image' content="dkjhasdjjkhjkasdjkjkka...."/>
如何解决这个问题?