PDO insert error

rangedshock

New Member
I'm trying to get the code below to work.....The error:\[code\]ERRORSQLSTATE[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 '?, ?, ?, ?)' at line 1\[/code\]The code:\[code\]$data=http://stackoverflow.com/questions/3842183/array($idApplications,$author,$addedOn,$note);try { $STH = $this->DBH->query(' INSERT INTO '.$table.' (idApplications,Author,NoteAddedOn,Note) VALUES (?, ?, ?, ?) '); $STH->execute($data);}catch(PDOException $e) {echo $e->getMessage();}} \[/code\](Using PHP PDO and MySQL)Any help would be appreciated!Thanks!
 
Back
Top