php - PHP 7.2 Apache not executing all php code
问题描述
Really confusd here. PHP is working until it gets to an IF statement any suggestions / help greatly appreciated.
$sql2=("SELECT * FROM temporders WHERE cusid='$myid'");
$result2=mysqli_query($connP,$sql2);
$count2=mysqli_num_rows($result2);
$total=0;
$itemNum=0;
if ($count2>0) {
while($row2 = mysqli_fetch_array($result2, mysqli_ASSOC)) {
$total=($total+($row2['price']*$row2['qty']));
$itemNum=$itemNum+$row2['qty'];
}
}
if ($total<1) {
$total=0;
} else {
$total=number_format($total, 2, '.', '');
}
?>
<div class="basket">
All of the bove works perfect until it gets to here which is the next stage it produces this when i view the page source code. All php is showing from this stage onwards
<div class="basket">
<?
if ($total==0) {
?>
<form action="../customer-page.html" method="get" name="cart" id="cart">
<?
} else {
?>
<form>
<?
}
?>
<input type="hidden" name="page" id="page" value="southern-spas-saunas.html" />
<input type="hidden" name="delitem" value="0" />
<input type="hidden" name="myid" value="202003220001" />
<table width="250" border="0">
<tr>
<td width="45"><input name="image2" type="image" value="Process" src="../1basket.gif" /></td>
<td width="120">Total £ 0</td>
<td>Items 0</td>
</tr>
</table>
</form>
</div>
解决方案
推荐阅读
- javascript - 如何修复对象的旋转以跟随客户的鼠标?
- java - 如何在 StringProperty 和组合框 SelectedItemProperty 之间进行双向绑定
- java - FileWriter在创建csv时在单个单元格中写入html
- python - 由于python tkinter中另一个网格元素的内容更新,如何阻止一个网格元素的位置发生变化?
- python - 使用 selenium(python) 上传文件,输入元素在 iframe 内
- r - 编码要定向的贸易数据
- html - 如何在 div 中创建文本换行符?
- python - 为什么 Python 函数:type("This is a string') - 在 PyCharm IDE 中不返回任何结果,但它返回
在 IDLE 和其他编辑器中? - c++ - FlowLayout如何对齐中心?
- javascript - 如何在鼠标悬停事件中捕捉鼠标左键?