我使用这个功能:
function edit_post($id, $title, $content, $img) {
global $connect;
$id = (int)$id;
$title = mysql_real_escape_string($title);
$content = mysql_real_escape_string(nl2br($content));
$img = mysql_real_escape_string($img);
$date_posted = date("Y-m-d H:i:s");
mysqli_query($connect, "UPDATE `topics` SET
`title` = '$title',
`content` = '$content',
`img` = '$img' WHERE `id` = {$id}");
}
要对数据库进行更新..
并通过以下方式调用它:
edit_post($ _ GET ['id'],$ title,$ content,$ img);
但它没有进行我想要的更新
答案 0 :(得分:0)
功能是否正在通话?也许你必须像这样调用这个函数:
$this->edit_post($_GET['id'], $title, $content, $img);