0

I have a MYSQL Data called last_seen and its datatype is TIMESTAMP, should I save it as a String in PHP?

 * @property boolean                                  verified_address
 * @property boolean                                  verified_email
 * @property string                                   last_seen 
11
  • 1
    no need to store anything,it will update the current datetime automatically whenever a transaction is made Commented Mar 30, 2019 at 5:40
  • 1
    nope, never ever store date,time, dateTime, Timestamp into string. Commented Mar 30, 2019 at 5:46
  • 1
    Timestamp is fine for last_seen. Commented Mar 30, 2019 at 6:10
  • 1
    I think it's a comment of a docBlocker check your db structure what datatype you're using. Commented Mar 30, 2019 at 6:14
  • 1
    refer stackoverflow.com/questions/34418077/… Commented Mar 30, 2019 at 6:20

1 Answer 1

0

Since TIMESTAMP isn't a php data type, you have to use 'mixed' for the @property.

In the documentation you have examples for diferent data types (https://manual.phpdoc.org/HTMLSmartyConverter/PHP/phpDocumentor/tutorial_tags.property.pkg.html)

For your case it would be like this

/**
 * @property boolean  verified_address
 * @property boolean  verified_email
 * @property mixed    $last_seen
*/
Sign up to request clarification or add additional context in comments.

Comments

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.