php - html 中的时间戳

标签 php html mysql

我正在尝试在数据库中存储时间戳。 HTML 代码:

<form action="insert.php" method="POST"/>

<style>
p{
    float:center;
}
</style>


<Font color=red > <center>Support or Analysis Tracker (SoAT) </center></Font>
</br>
</br>

<p align="left">
<label for="PROCESS"><FONT color=default>Analysis/Support</label> &nbsp</t>
 <select id="PROCESS" name="PROCESS">
<option value="Analysis">Analysis</option>
<option value="Support">Support</option>
</select> 
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<label for="SO_NUMBER"><FONT color=default>SO_Number</label>
    <input type="text" id="SO_NUMBER" name="SO_NUMBER"  value ="SO_" required/>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
  <label for="PERSON_INCHARGE"><FONT color=default>Person_Incharge</label>
  <input type="text" id="PERSON_INCHARGE" name="PERSON_INCHARGE" required/></br>
</br></br>
</br>
</p>
<p align="left">
    <label for="DESCRIPTION"><FONT color=default>Description</label>
    <input type="text" id="DESCRIPTION" name="DESCRIPTION" />

</p>

</br>
    </br>
<div style="text-align:center"> 
<button>

   <img alt="ok" src=
   "http://www.blueprintcss.org/blueprint/plugins/buttons/icons/tick.png" /> 

INSERT
  </button>
</fieldset>
</form>

点击插入按钮后,我需要将当前时间和日期存储在数据库中。后台数据库结构如下:

Database structure

最佳答案

在这些情况下,您可以使用 mysql 的 from now() 函数。

Insert INTO tablename(RECEIVED) VALUES(now())

通过这个结构,它使用来自 mysql 服务器的日期和时间

关于php - html 中的时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37427961/

相关文章:

PHP:将共享用户数据作为 JSON 字符串存储在 MySQL 中是多么糟糕的想法?

mysql - MySQL 两个结果集之间的差异

php - 查询架构以获取用户关注的帖子

javascript - jquery/javascript 随机选择选项

javascript - 在Javascript html CSS中将模态与 Electron js中的模态相同吗?

javascript - 改变输入复选框的状态 AngularJS

python - 在 Django 中访问同一数据库中的其他表

php - 如何找到修改了哪个输入字段?

php - 在循环中使用 sql 查询

php - 使用 preg_replace 删除所有非字母数字字符