PHP MYSQL 插入不工作并且没有收到错误

PHP MYSQL insert doesn't work and receive no error

我有这个 PHP 代码,我会在 table 中插入一个数据。 我不知道为什么,它不起作用。我没有收到查询错误。 如果我打印 $update_miner 什么也没有显示。 这是代码:

<?php


session_start();
include("header.php");
$building['rock_miner'] =3;
$current_time = time();
$update_miner = mysqli_query($connection,"INSERT INTO `updates_queue` (`user_id`,`content`, `start_at`,`end_at`,`finished`,`old_level`) VALUES ('".$_SESSION['uid']."', 'rock_update', '".$current_time."','".$current_time."',0 ,'".$building['rock_miner']."'");




include("footer.php");

?>

这是table:

不太确定,但不会使用 int 来存储时间。 Int 只会上升到某个值,然后就会失败——或者只存储它能存储的最高值。不过,我认为这可能取决于您的 mysql 版本。

之前的评论是一个好的开始,请确保您也已连接到数据库。

所以你的$connection不是假的。

你终于少了一个括号

INSERT INTO `updates_queue` (`user_id`,`content`, `start_at`,`end_at`,`finished`,`old_level`)
VALUES ('".$_SESSION['uid']."', 'rock_update', '".$current_time."',
'".$current_time."',0 ,'".$building['rock_miner']."')")
                                                    ^