Xyz
Xyz

Reputation: 167

Every attempt at insert fails

Can anyone tell me why none of these inserts work?

insert into users password values ("e10adc3949ba59abbe56e057f20f883e") where ID = 36;

insert into users (password) values ("e10adc3949ba59abbe56e057f20f883e") where ID = 36;

insert into users ("password") values ("e10adc3949ba59abbe56e057f20f883e") where ID = 36;

Upvotes: 0

Views: 43

Answers (3)

nitin.sharma0180
nitin.sharma0180

Reputation: 475

You can't do INSERT with WHERE clause

Maybe you needed to do UPDATE

UPDATE users SET password ='e10adc3949ba59abbe56e057f20f883e' WHERE ID=36;

Upvotes: 1

exussum
exussum

Reputation: 18550

You need an update.

 Update users set password="something" where Id=36

Would be the correct syntax

Upvotes: 3

Sachit Murarka
Sachit Murarka

Reputation: 183

Query seems to be wrong. You are using Insert into and at the last you are using Where clause.

Upvotes: 0

Related Questions