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

4
  • Check this out Commented May 7, 2013 at 7:16
  • 1
    What's your problem? Why are you using WHERE? Commented May 7, 2013 at 7:16
  • :) I just read what you said.... I need UPDATE... so sorry... Commented May 7, 2013 at 7:17
  • thankyou guys... I'll be smarter in the future... appologies... Commented May 7, 2013 at 7:17

1 Answer 1

3

maybe you mean UPDATE

UPDATE `table` 
SET    `name` = ?,
       `data` = ?,
       `other` = ?,
       `datetime` = ?
WHERE  `id` = ?
Sign up to request clarification or add additional context in comments.

1 Comment

:) cheers... appreciated...

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.