Sugumar Venkatesan
Sugumar Venkatesan

Reputation: 4038

Mysql: Inserting now() value into column shows error

I am trying to insert now() value into a column but it shows error

insert into tbl_offerpriceuser('urgentdate') values(NOW()) where user_id='717'

It shows 3 errors

3 errors were found during analysis.

A comma or a closing bracket was expected (near "(" at position 55)
Unexpected token. (near ")" at position 56)
Unexpected token. (near ")" at position 57)

Upvotes: 0

Views: 1893

Answers (3)

Pathik Vejani
Pathik Vejani

Reputation: 4501

Syntax is wrong for insert:

insert into tbl_offerpriceuser(urgentdate) values(NOW())

NOW() function don't have any problem. And there is no WHERE condition.

See the Syntax to Insert data

Upvotes: 3

cos nik
cos nik

Reputation: 386

Thats the correct syntax:

INSERT INTO tbl_offerpriceuser(`urgentdate`) values(NOW()) WHERE `user_id`='717'

Upvotes: -2

mazedlx
mazedlx

Reputation: 1455

There is no where clause in insert statements

insert into tbl_offerpriceuser('urgentdate') values(NOW());

Upvotes: 1

Related Questions