语法错误,意外'$ item_count'(T_VARIABLE) [英] Syntax error, unexpected '$item_count' (T_VARIABLE)
本文介绍了语法错误,意外'$ item_count'(T_VARIABLE)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
(!)解析错误:语法错误,第53行的C:\ wamp64 \ www \ all4you \ cart.php意外'$ item_count'(T_VARIABLE)
我尝试了什么:
( ! ) Parse error: syntax error, unexpected '$item_count' (T_VARIABLE) in C:\wamp64\www\all4you\cart.php on line 53
What I have tried:
<?php
require_once 'dbconnect.php';
include ('pages/header.php');
include ('pages/detals-menu.php');
if ($cart_id!='') {
$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;
}
?>
<div class="col-md-12">
<div class="container">
<div class="row">
<h3 class="text-center">ჩემი კალათა</h3><hr>
<?php if ($cart_id==''): ?>
<div class="bg-danger">
<p class="text-center text-danger">
კალათა ცარიელია!
</p>
</div>
<?php else: ?>
<?php
foreach ($items as $item) {
$product_id=$item['id'];
$productQ=$db->query("SELECT *FROM products WHERE id='{$product_id}'");
$product=mysqli_fetch_assoc($productQ);
$sArray=explode(',', $product['sizes']);
foreach ($sArray as $sizeString) {
$s=explode(':', $sizeString);
if ($s[0]==$item['size']) {
$available=$s[1];
}
}
?>
<?php
$i++
$item_count+=$item['quantity'];
$sub_total+=($product['price'] * $item['quantity']);
}
$tax=TAXRATE* $sub_total;
$tax=number_format($ax,2);
$grand_total=$tax+$sub_total;
?>
<table class="table table-bordered table-condensed table-striped"><thead><tr><th>#</th><th>პროდუქცია</th><th>ფასი</th><th>რაოდენობა</th><th>ზომა</th><th>ჯამი</th></tr></thead> <tbody><tr> <td><?=$i;?></td> <td><?=$product['title'];?></td> <td><?=money($product['price']);?></td> <td><?=$item['quantity'];?></td> <td><?=$item['size'];?></td> <td><?=money($item['quantity'] * $product['price']);?></td> </tr></tbody> </table>
ჯამი
<table class="table table-bordered table-condensed text-right"><thead class="totals-table-header"><tr><th>პროდუქციის რაოდენობა</th><th>სულ ჯამში</th><th>tax</th><th>gran total</th></tr></thead> <tbody> <tr> <td><?=$item_count; ?></td> <td><?=money($sub_total); ?></td> <td><?=money($tax); ?></td> <td class="bg-success"><?=money($grand_total); ?></td> </tr> </tbody> </table>
<?php endif; ?>
</div>
</div>
</div>
<?php
include('pages/footer.php');
?>
推荐答案
item_count'(T_VARIABLE)在第53行的C:\ wamp64 \ #www.all4you \ cart.php
我尝试了什么:
item_count' (T_VARIABLE) in C:\wamp64\www\all4you\cart.php on line 53
What I have tried:
<?php
require_once 'dbconnect.php';
include ('pages/header.php');
include ('pages/detals-menu.php');
if (
cart_id!= ' < span class =code-string>'){
cart_id!='') {
cartQ =
这篇关于语法错误,意外'$ item_count'(T_VARIABLE)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文