我有这个 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");
?>
这是表格:
最佳答案
你终于少了一个括号
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/