2 回答

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超13個(gè)贊
您在一行上缺少一個(gè)分號(hào),即:
$dateFrom = $_POST['date_from'];
$dateTo = $_POST['date_to'];
$instructorId = $_POST['instructor_id'];
$seminarsId = $_POST['seminars_id'];
$clientsId = $_POST['clients_id'] <----
$sql = 'INSERT INTO dateof_seminars (date_from, date_to, instructor_id, seminars_id, clients_id) VALUES (:date_from, :date_to, :instructor_id, :seminars_id, :clients_id)';
$stmt = $db->prepare($sql);
因此,下一行是出乎意料的,編譯器不知道該如何處理它。$sql

TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超6個(gè)贊
在提到的第34行(這個(gè):$sql = 'INSERT INTO dateof_seminars (date_from, date_to, instructor_id, seminars_id, clients_id) VALUES (:date_from, :date_to, :instructor_id, :seminars_id, :clients_id)';
)
你必須用雙引號(hào)替換單引號(hào),就像這樣
$sql = "INSERT INTO dateof_seminars (date_from, date_to, instructor_id, seminars_id, clients_id) VALUES (:date_from, :date_to, :instructor_id, :seminars_id, :clients_id)";
據(jù)我所知,你不能在單引號(hào)中使用變量。
- 2 回答
- 0 關(guān)注
- 129 瀏覽
添加回答
舉報(bào)