原生php mysql添加时间戳
时间:2022-03-15 15:03
$nowtime= time(); $sql = "insert into user ( username,create_time ) values (‘萨达姆‘,‘$nowtime‘)"; if(mysqli_query($conn,$sql)){ echo ‘添加成共‘; }
这样就行了,定义一个变量 时间戳是10位数的整数
时间:2022-03-15 15:03
$nowtime= time(); $sql = "insert into user ( username,create_time ) values (‘萨达姆‘,‘$nowtime‘)"; if(mysqli_query($conn,$sql)){ echo ‘添加成共‘; }
这样就行了,定义一个变量 时间戳是10位数的整数