session_destroy():试图破坏未初始化的会话错误

时间:2019-04-22 05:37:10

标签: php

我要使用此代码在session_destroy无法正常工作后调用一次插入数据。我正在使用PHP 7.2选通错误。请帮助我...

警告:session_destroy():尝试在第233行的D:\ xammp \ htdocs \ listing \ category.php中破坏未初始化的会话

 <?php

    if(isset($_POST['submit-rate'])) {

    $inventory_id = mysqli_real_escape_string($conn, $_POST['inventory_id']);

    $ratingNumber = mysqli_real_escape_string($conn, $_POST['ratingNumber']);

    $title = mysqli_real_escape_string($conn, $_POST['title']);

    $comments = mysqli_real_escape_string($conn, $_POST['comments']);

    $status = '1';

    $created   = date('Y-m-d H:i:s');

    $query = "INSERT INTO  item_rating(inventory_id,ratingNumber,title,comments,status,created) 
                                        VALUES('$inventory_id','$ratingNumber','$title','$comments','$status','$created')";

            $run= mysqli_query($conn, $query);

            $msg="Successfully Added your Rate This Inventory Thank you";      

         }
        session_destroy();
    ?>

0 个答案:

没有答案