0

I'm trying to insert current date and time to activitystamp as unix_timestamp. But i just get 0 as result.

INSERT INTO `skadate`.`ow_base_user_online` (`id`, `userId`, `activityStamp`, `context`, `misc`) 
VALUES (NULL, '1402', 'UNIX_TIMESTAMP()', '1', '1');
1
  • you're not calling a function. you're passing a string which contains text that LOOKS like a function call. Commented Dec 17, 2014 at 18:41

1 Answer 1

3

MySQL functions should not be in quotes:

INSERT INTO `skadate`.`ow_base_user_online` (`id`, `userId`, `activityStamp`, `context`, `misc`) 
VALUES (NULL, '1402', UNIX_TIMESTAMP(), '1', '1');
Sign up to request clarification or add additional context in comments.

1 Comment

It's usually a simple thing like that :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.