我有一个我要插入数据库的输入数组。 我不希望数组中的每一项都有1行。 我希望他们都能在同一排。 所以这是我的代码: p>
<?php
session_start();
include('../../ config / dbconf.php');
\ nmysqli_select_db($ conn,$ webdb);
$ stmt = $ conn-> prepare(“INSERT INTO changelog(title,type,content,author,post_date)VALUES(?,?,?,?,?) “);
$ title = $ _POST ['title'];
$ type = $ _POST ['type'];
$ change = $ _POST ['change'];
$ author = $ _SESSION ['waradmin'];
$ date = time();
foreach($ _ POST ['change'] as $ key => $ value){
$ changes =“< li>” 。 $ change [$ key]。 “< / li>”;
}
$ stmt-> bind_param(“sissi”,$ title,$ type,$ changes,$ author,$ date);
if($ stmt-> execute()){
header('location:../?p = dashboard'); \\}}} {}} {}} $ stmt->错误;
}
$ stmt-> close();
?>
code> pre>
查询在数据库中运行 但只有数组中的第一个列表项...我是否需要使用内爆函数? 我从来没有使用它,所以如果这是唯一的解决方案,有人可以告诉我如何在此查询中使用它吗? p>
div>