不确定此行有什么问题请帮忙
$sql = "INSERT INTO Official (name,description) VALUES ('{mysqli->real_escape_string($_POST['name'])}' , '{mysqli->real_escape_string($_POST['Description'])} ')";
答案 0 :(得分:0)
只是你的PHP语法错误,应该如下:
$mysqli = new mysqli("server", "user", "password", "database");
//---------------------
// some other code here
//---------------------
$name = $mysqli->real_escape_string($_POST['name']);
$desc = $mysqli->real_escape_string($_POST['Description']);
$sql = "INSERT INTO Official (name, description) VALUES ('".$name."', '".$desc."')";