gpt4 book ai didi

php - 如何将 SQL 表中字段的内容用作 HTML

转载 作者:太空宇宙 更新时间:2023-11-03 10:52:34 26 4
gpt4 key购买 nike

<分区>

我想将 SQL 表中字段的内容用作 HTML。表格字段包含 HTML。

表名:“目的地”
存储在名为“post”的列中的 HTML 代码
表主键:“destId”

我的 PhP 代码(当然在 PhP 标签内:

// Selects the post from destinations table
$sql = "SELECT post FROM `destination` WHERE destiD = 1;"; //SQL Query
$result = mysqli_query($con, $sql) or die(mysqli_error($con)); //run the query

echo $result; // Inserts HTML

收到错误:

Catchable fatal error: Object of class mysqli_result could not beconverted to string inC:\xampp\htdocs\travel\including\destinations\1-London.php on line 6

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