您的位置:首页 > 博客中心 > 数据库 >

原生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位数的整数

热门排行

今日推荐

热门手游