What's the recommended way to store current time using PHP and MySQL?

前端 未结 5 1405
时光说笑
时光说笑 2020-12-31 10:55

My initial approach was:

$current = time(); // save this to column CURRENT_TIME with column type VARCHAR

//retrieve it like this
$retrieved = mysql_query(..         


        
5条回答
  •  轮回少年
    2020-12-31 11:30

    I just use the TIMESTAMP value type in MySQL, and let MySQL use its own CURRENT_TIMESTAMP.

提交回复
热议问题