SQLSTATE[42000]: Syntax error or access violation: 1064 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 '( SET user_id = '40', title = 'awfawfawfawf', descri' at line 1
Iemand een idee wat ik hier fout doe?
<?
try {
if($_SESSION['editjob']) {
$sql = "UPDATE css_jobs (
SET
user_id = :user_id,
title = :job_title,
description = :job_description,
location = :job_location,
company_name = :company_name,
company_www = :company_www,
apply = :job_apply,
posted = NOW()
WHERE job_id = :job_id";
} else {
$sql = "INSERT INTO css_jobs (
user_id,
title,
description,
location,
company_name,
company_www,
apply,
posted
)
VALUES (
:user_id,
:job_title,
:job_description,
:job_location,
:company_name,
:company_www,
:job_apply,
NOW())";
}
$stmt = PDO_Connect()->prepare($sql);
$stmt->bindParam(':user_id', $_SESSION['userinfo']['id'], PDO::PARAM_INT);
$stmt->bindParam(':job_title', $_SESSION['postjob']['job_title']);
$stmt->bindParam(':job_description', $_SESSION['postjob']['job_description']);
$stmt->bindParam(':job_location', $_SESSION['postjob']['job_location']);
$stmt->bindParam(':company_name', $_SESSION['postjob']['company_name']);
$stmt->bindParam(':company_www', $_SESSION['postjob']['company_www']);
$stmt->bindParam(':job_apply', $_SESSION['postjob']['job_apply']);
if($_SESSION['editjob']) {
$stmt->bindParam(':job_id', $_GET['job_id'], PDO::PARAM_INT);
}
$stmt->execute();
} catch(PDOException $e) {
db_error($e);
}
>