0

Can someone give me a kick in the right direction with this:

    $sql='INSERT INTO table (name,data,other,datetime) VALUES (?,?,?,NOW()) WHERE id=?;';
    $pds=$database->pdo->prepare($sql);
    $pds->execute(array($a,$b,$c,$id));

what are I doing wrong here?

Note: I've INSERTED before successfully using PDO. The only difference is the WHERE id=?...

thankyou

Adam
  • 19,932
  • 36
  • 124
  • 207

1 Answers1

3

maybe you mean UPDATE

UPDATE `table` 
SET    `name` = ?,
       `data` = ?,
       `other` = ?,
       `datetime` = ?
WHERE  `id` = ?
Yogesh Suthar
  • 30,424
  • 18
  • 72
  • 100
John Woo
  • 258,903
  • 69
  • 498
  • 492