我想嵌入我的web應用程序到服務器,在localhost沒有問題,但是當我把我的應用程序並運行它有幾個問題。錯誤MySQL服務器版本的正確語法使用附近''在第1行
這是問題
UPDATE HistoriKegiatan SET TglSelesaiPemberkasan = CURDATE(), WaktuSelesaiPemberkasan = CURTIME() WHERE IdHistori = 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 " at line 1
這是我的代碼
$idKegiatan = (int) $_GET['idkegiatan'];
$NmKegiatan = $_GET['nmkegiatan'];
$transferto = $_POST['transferto'];
$catatan = $_POST['catatan'];
$tim = $_SESSION['team'];
$username = $_SESSION['user_name'];
$sql = "SELECT Max(IdHistori) as LastHId FROM HistoriKegiatan WHERE IdHistori IN (Select IdHistori from HistoriKegiatan where idKegiatan = $idKegiatan)";
$result = dbQuery($sql);
$no = dbNumRows($result);
$data = dbFetchAssoc($result);
$lastHId = $data['LastHId'];
$sql = "UPDATE HistoriKegiatan SET TglSelesaiPemberkasan = CURDATE(), WaktuSelesaiPemberkasan = CURTIME() WHERE IdHistori = $lastHId ";
echo $sql;
dbQuery($sql);
任何人都可以幫我解決這個問題? 對不起,我的英語
瞭解準備小號物業 – Jens
看起來像'$ lastHId'沒有設置 – Jens
請發佈您的數據庫架構 - 表,列等 –