Is there something wrong with this insert statement?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Is there something wrong with this insert statement?

Post by GeXus »

Code: Select all

INSERT INTO users (last_login) values (now()) where user_id = 3
Thanks
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Yes.
where user_id = 3
has nothing to do with insert.
Are you looking for UPDATE or REPLACE?
Post Reply