Home Ask Login Register

Developers Planet

Your answer is one click away!

Sugumar Venkatesan February 2016

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)


Pathik Vejani February 2016

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

mazedlx February 2016

There is no where clause in insert statements

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

cos nik February 2016

Thats the correct syntax:

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

Post Status

Asked in February 2016
Viewed 1,796 times
Voted 5
Answered 3 times


Leave an answer

Quote of the day: live life