小编Jkl*_*lyn的帖子

在php的主页上从数据库中提取og:image时显示的错误?

我从mysql数据库中提取了要在facebook共享上看到的og图像.下面的代码已经有效,但唯一的问题是它显示错误:" /> 在我的主页顶部.

如何" />从我的主页上删除此标志?我在这段代码上犯了什么错误吗?

对我的问题的任何指导表示赞赏.

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <?php
    $fetch_sql = "SELECT fld_news_pictures,  fld_news_name, fld_news_details FROM tbl_news ";
    $fetch_result= mysql_query($fetch_sql) or die(mysql_error()); 
    while($fetch_row=mysql_fetch_array($fetch_result))
    {
    $fld_news_name = $fetch_row['fld_news_name'];
    $fld_news_pictures = $fetch_row['fld_news_pictures'];
    $fld_news_details = $fetch_row['fld_news_details'];
    ?>
    <meta property="og:title" content="<?php echo $fld_news_name; }?>" />
    <meta property="og:image" content="http://mysite/images/<?php echo $fld_news_pictures; ?>" />
    <meta property="og:description" content="<?php echo $fld_news_details } ?>" />
Run Code Online (Sandbox Code Playgroud)

php mysql database facebook

1
推荐指数
1
解决办法
137
查看次数

标签 统计

database ×1

facebook ×1

mysql ×1

php ×1