当试图访问数据库时,php页面变为空白

当试图访问数据库时,php页面变为空白,php,database,forms,mysqli,Php,Database,Forms,Mysqli,我有一个问题,我的插入代码似乎是错误的,但我不知道如何修复它 它一直求助于我的页面是空白的,没有错误日志,错误报告也不起作用,下面是代码 <?php $connect = mysqli_connect("localhost","dfhdfhd","dfhdfh","fhgdfh"); $url = 'url'; $banner = 'banner'; $title = 'title'; $date = 'date'; $time = 'time'; $description = 'des

我有一个问题,我的插入代码似乎是错误的,但我不知道如何修复它

它一直求助于我的页面是空白的,没有错误日志,错误报告也不起作用,下面是代码

<?php
$connect = mysqli_connect("localhost","dfhdfhd","dfhdfh","fhgdfh");

$url = 'url';
$banner = 'banner';
$title = 'title';
$date = 'date';
$time = 'time';
$description = 'description';
$region = 'region';
$sponsors = 'sponsors';

mysqli_query($connect,"INSERT INTO information (url, banner, title, date, time, description, region, sponsors)
VALUES ('$url', '$banner', '$title', '$date' '$time', '$description', '$region', '$sponsors')";
?>

如果查询因某种原因无法运行,则应添加错误报告并显示mysqli错误:

<?php
error_reporting(-1);
$connect = mysqli_connect("localhost","dfhdfhd","dfhdfh","fhgdfh");
if (mysqli_connect_errno())
{
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$url = 'url';
$banner = 'banner';
$title = 'title';
$date = 'date';
$time = 'time';
$description = 'description';
$region = 'region';
$sponsors = 'sponsors';

$result = mysqli_query($connect,"INSERT INTO information (url, banner, title, date, time, description, region, sponsors)
VALUES ('$url', '$banner', '$title', '$date', '$time', '$description', '$region', '$sponsors')");
if (!result)
{
    echo("Error description: " . mysqli_error($connect));
}
?>

这里有一些地方不对劲

首先,在
'$date'
之后缺少逗号,在开头
$connect,

在这里:

检查错误后,它会告诉您这些错误

请参考以下链接和



您当前的代码对用户开放。使用,或与插入查询中的。

缺少最后一个
检查页面中的错误非常感谢。另外,谢谢你的消息来源!
mysqli_query($connect,"INSERT INTO information (url, banner, title, date, time, description, region, sponsors)
VALUES ('$url', '$banner', '$title', '$date', '$time', '$description', '$region', '$sponsors')");