mysqli_close()期望恰好有1个参数,给定0

时间:2018-11-16 15:24:34

标签: php mysql mysqli

我收到此错误:

  

警告:mysqli_close()期望恰好有1个参数,其中0个给定   C:\ wamp64 \ www \ workshop \ insert.php在第38行

我不知道哪里出了问题。我已经尝试过mysqli_close($conn);。错误消失了,但我仍然无法保存。

<?php
include ('connection.php');
session_start();
if (!isset($_SESSION ['userId'])&& empty($_SESSION['userId'])){
    header ("location:login.php");
    exit;
}
else {
    $userId = $_SESSION ['userId'];
}

$userFullname = $_POST["userFullname"];
$userEmail = $_POST["userEmail"];
$userContactnumber = $_POST["userContactnumber"];
$userAddress = $_POST ["userAddress"];
$weddingDate = $_POST ["weddingDate"];
$weddingVenue = $_POST ["weddingVenue"];
$weddingGuests = $_POST ["weddingGuests"];
$weddingTheme = $_POST ["weddingTheme"];
$weddingRequest = $_POST ["weddingRequest"];

$query = mysqli_query ($conn, "INSERT INTO quotation (userFullname  , userEmail , userContactnumber , userAddress , weddingDate , weddingVenue , weddingGuests , weddingTheme , weddingRequest ) VALUE (' $userFullname ',' $userEmail ',' $userContactnumber ',' $userAddress ',' $weddingDate ',' $weddingVenue ',' $weddingGuests ',' $weddingTheme ',' $weddingRequest ')");
if ($query == TRUE)
    {
        echo "<script language='javascript'>";
        echo "alert('Save Succeed.');";
        echo "window.location.href='insert.php';";
        echo "</script>";
    }
    else
    {
        echo "<script language='javascript'>";
        echo "alert('Save Failed.');";
        //echo "window.location.href='insert.php';";
        echo "</script>";
    }
mysqli_close();?>

请帮助。

0 个答案:

没有答案