Skip to content

Instantly share code, notes, and snippets.

@gerasimua
Created October 3, 2015 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerasimua/ef4e2a7f9284ffe68744 to your computer and use it in GitHub Desktop.
Save gerasimua/ef4e2a7f9284ffe68744 to your computer and use it in GitHub Desktop.
On duplicate update all values
INSERT INTO sessions (user_id, token, expires, session_data)
VALUES (?, ?, FROM_UNIXTIME(?), ?)
ON DUPLICATE KEY UPDATE user_id=VALUES(user_id), expires=VALUES(expires), session_data=VALUES(session_data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment