Click here to Skip to main content
15,902,198 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Notice: Trying to access array offset on value of type null in C:\xampp\htdocs\Web-RestoranTableService-master\pagePelanggan.php on line 16

Notice: Trying to access array offset on value of type null in C:\xampp\htdocs\Web-RestoranTableService-master\pagePelanggan.php on line 26



AuthUser($_SESSION['username']);
$auth2 = $id->AuthPelanggan($_SESSION['username']);
$response = $id->sessionCheck();
if ($response == "false") {
header("Location:index.php");
}
$no_meja = $auth2['no_meja'];
$sql2 = "SELECT kd_order FROM tb_order WHERE no_meja='$no_meja'";
$exe2 = mysqli_query($con, $sql2);
$num2 = mysqli_num_rows($exe2);
$dta2 = mysqli_fetch_assoc($exe2);
$data_kd = $dta2['kd_order'];
$sql3 = "SELECT status_detail FROM tb_detail_order_temporary WHERE order_kd='$data_kd'";
$exe3 = mysqli_query($con, $sql3);
$num3 = mysqli_num_rows($exe3);
$dta3 = mysqli_fetch_assoc($exe3);
$data_kd2 = $dta3['status_detail'];
$sql4 = "SELECT status_order FROM tb_order WHERE kd_order='$data_kd'";
$exe4 = mysqli_query($con, $sql4);
$num4 = mysqli_num_rows($exe4);
$dta4 = mysqli_fetch_assoc($exe4);
$data_kd3 = $dta4['status_order'];
if (isset($_GET['delete'])) {
if ($data_kd3 == "belum_beli") {
?>


$(document).ready(function() {
swal({
title: "Tidak Order?",
text: "Anda belum membeli apapun",
type: "warning",
showCancelButton: true,
confirmButtonText: "Ya, Tidak Beli",
cancelButtonText: "Beli",
closeOnConfirm: false,
closeOnCancel: true
}, function(isConfirm) {
if (isConfirm) {
<?php
$response = $id->delete("tb_order", "kd_order", $_GET['kd'], "?page=dashboard");
$id->logout2();
?>
} else if (!isConfirm) {
window.location.href = "?";
}
});
})

'negative', 'alert' => 'Pesanan anda belum sampai'];
} elseif ($data_kd2 == "siap" || $data_kd2 == "diambil") {
$response = $id->delete("tb_detail_order_temporary", "kd_order", $_GET['kd'], "?page=dashboard");
$id->logout2();
}
}
?>

What I have tried:

searches but useless i asked to seniors but they not found it
Posted
Updated 8-Aug-21 11:56am

1 solution

Look ate the error messages carefully - they tell you where the problem is (line 16, line 26) and what the problem is: something contains no value and you are trying to use that to access an array.

Now you know that kd_order and status_detail have no value, you can use the debugger to follow your code through while it is executing and find out why...

We can't do that for you: we can't run your code under the same conditions you do.
 
Share this answer
 
Comments
sabo tase 8-Aug-21 18:34pm    
how to use debugger ?
OriginalGriff 9-Aug-21 2:13am    
You are kidding, right?
https://www.php.net/manual/en/debugger.php

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900