如何解決注意:未定義的索引:cart_id在C:\ xampp \ htdocs \ istore \ cart中。 PHP的第6行如何解決注意:未定義的變量:C: xampp htdocs istore cart.php中的cart_id在第6行
<?php
require_once $_SERVER['DOCUMENT_ROOT'].'/istore/core/init.php';
include 'includes/category_head.php';
include 'includes/cart-header.php';
if($cart_id != ''){
\t
$cartQ = $db->query("SELECT * FROM cart WHERE id = '{$cart_id}'");
$result = mysqli_fetch_assoc($cartQ);
$items = json_decode($result['items'],true);
$i = 1;
$sub_total = 0;
$item_count = 0;
}
?>
有人請幫我解決這個問題。
lin在哪裏在你的代碼中的數字6? – Saty
if($ cart_id!=''){ – susan
您在哪裏定義'$ cart_id'? – Saty