I have added a new column that should store a timestamp value. This value currently exists in another table. So I tried to build a query to update my new column using the other table.
This is my current query:
UPDATE `gc_users` U
SET `registration_date` = ( SELECT `joindate`
FROM `vb_user`
WHERE `username` = U.`name`
LIMIT 0,1
)
The problem is that after updating registration_date the value is 0000-00-00 00:00:00
New table: gc_users
- Column: registration_date ( timestamp )
- Example:
2013-01-11 15:24:04
Source table: va_user
- Column: joindate ( int )
- Example:
1354290120
use
FROM_UNIXTIME