0
$q2 = "UPDATE `tasks` SET `title` = ?, task = ?, rules = ?, media = ?, type = ?, xp = ?, available = ?, timestamp = ? WHERE id = ?";
if ($stmt = $mysqli->prepare($q2)) {
$stmt->bind_param("sssssissi", $_POST["tasktitle"], $_POST["editor"], $_POST["rules"], serialize($_POST["media"]), $_POST["type"], $_POST["xp"], $a = 0, strtotime("now"), $_GET['id']);
$stmt->execute();
$stmt->close();
}
$r = $mysqli->query($q2) or die($mysqli->error);
我得到這個錯誤信息:調用與mysqli的準備 - SQL語法錯誤
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?, task = ?, rules = ?, media = ?, type = ?, xp = ?, available = ?, timestamp = ' at line 1
有什麼問題,我怎麼能解決呢?
這是我第一次使用這個功能。代碼從這裏:http://stackoverflow.com/questions/2206326/sql-error-when-using-apostrophes 如果我評論如果(..){和}錯誤仍然出現。 –
@TamásK,我沒有看到你鏈接的答案中的「查詢」行。這是您可能從以前的版本中留下的東西。 – paxdiablo
現在我明白了!謝謝 :) –