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

标签 php mysql insert

我有这个 PHP 代码,我会在表格中插入数据。 我不知道为什么,它不起作用。我没有收到查询错误。 如果我打印 $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");

?>

这是表格:

enter image description here

最佳答案

你终于少了一个括号

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']."')")
                                                    ^ 

关于PHP MYSQL 插入不起作用并且没有收到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33173669/

相关文章:

mysql - 为什么我的 InnoDB 表的大小限制为 600MiB?

php - 如何通过模态编辑mysql中的数据

java - 在 MySQL 中,如何仅在行不存在时插入并仅在现有版本较少时更新

c - 将一些数据插入文件的问题

php - 从 PHP 检索 .htaccess 登录名

php - 查询序列化数据

java - 如何从 unix 时间戳中提取小时数?

c# - Dapper - 使用嵌套对象插入

php - 使用 php mysql 翻转图像 onmouseover

php - 是否有一种叫做空合并运算符的东西,比如 Null 合并运算符