php語法:
<?php
$colname_web_shop2017 = "-1";
if (isset($_GET['p_id'])) {
$colname_web_shop2017 = $_GET['p_id'];
}
mysql_select_db($database_conn_web, $conn_web);
$query_web_shop2017 = sprintf("SELECT shop2.p_id, shop2.p_name, shop2.p_price, shop2.p_open, shop2.p_pic, shop2.inventory, orderlist.p_name,orderlist.odlist_ok, orderlist.odlist_qty, SUM( `orderlist`.`odlist_qty` ) AS orderlistNum ,shop2.inventory AS inventory , orderlist.odlist_ok AS odlist_ok ,orderlist.odlist_qty AS odlist_qty
FROM shop2
LEFT JOIN orderlist ON shop2.p_name = orderlist.p_name and orderlist.odlist_ok='y'
GROUP BY `orderlist`.`odlist_ok` , `shop2`.`p_id` , `shop2`.`p_name` , `orderlist`.`p_name`
HAVING p_id = %s ", GetSQLValueString($colname_web_shop2017, "int"));
$web_shop2017 = mysql_query($query_web_shop2017, $conn_web) or die(mysql_error());
$row_web_shop2017 = mysql_fetch_assoc($web_shop2017);
$totalRows_web_shop2017 = mysql_num_rows($web_shop2017);//段落
?>
<?php
$a=$row_web_shop2017['inventory'];
$b=$row_web_shop2017['orderlistNum'];
$c=$row_web_shop2017['op_name'];
$d=$row_web_shop2017['odlist_ok'];
?>
內文:
<?php if ($b == NULL ){ ?>
已購數量 <?php echo 0 ?>
<?php } // Show if recordset not empty ?>
<?php if ($b !== NULL ){ ?>
已購數量 <?php echo $b ?>
<?php } // Show if recordset not empty ?>
<?php if ($b == NULL ){ ?>
庫存 <?php echo $a; ?>
<?php } // Show if recordset not empty ?>
<?php if ($b !== NULL and $a-$b>=0){ ?>
庫存 <?php echo $a-$b; ?>
<?php } elseif ($b !== NULL and $a-$b<0){ ?>
庫存 <?php echo 0 ?>
<?php } // Show if recordset not empty ?>
<?php
$colname_web_shop2017 = "-1";
if (isset($_GET['p_id'])) {
$colname_web_shop2017 = $_GET['p_id'];
}
mysql_select_db($database_conn_web, $conn_web);
$query_web_shop2017 = sprintf("SELECT shop2.p_id, shop2.p_name, shop2.p_price, shop2.p_open, shop2.p_pic, shop2.inventory, orderlist.p_name,orderlist.odlist_ok, orderlist.odlist_qty, SUM( `orderlist`.`odlist_qty` ) AS orderlistNum ,shop2.inventory AS inventory , orderlist.odlist_ok AS odlist_ok ,orderlist.odlist_qty AS odlist_qty
FROM shop2
LEFT JOIN orderlist ON shop2.p_name = orderlist.p_name and orderlist.odlist_ok='y'
GROUP BY `orderlist`.`odlist_ok` , `shop2`.`p_id` , `shop2`.`p_name` , `orderlist`.`p_name`
HAVING p_id = %s ", GetSQLValueString($colname_web_shop2017, "int"));
$web_shop2017 = mysql_query($query_web_shop2017, $conn_web) or die(mysql_error());
$row_web_shop2017 = mysql_fetch_assoc($web_shop2017);
$totalRows_web_shop2017 = mysql_num_rows($web_shop2017);//段落
?>
<?php
$a=$row_web_shop2017['inventory'];
$b=$row_web_shop2017['orderlistNum'];
$c=$row_web_shop2017['op_name'];
$d=$row_web_shop2017['odlist_ok'];
?>
內文:
<?php if ($b == NULL ){ ?>
已購數量 <?php echo 0 ?>
<?php } // Show if recordset not empty ?>
<?php if ($b !== NULL ){ ?>
已購數量 <?php echo $b ?>
<?php } // Show if recordset not empty ?>
<?php if ($b == NULL ){ ?>
庫存 <?php echo $a; ?>
<?php } // Show if recordset not empty ?>
<?php if ($b !== NULL and $a-$b>=0){ ?>
庫存 <?php echo $a-$b; ?>
<?php } elseif ($b !== NULL and $a-$b<0){ ?>
庫存 <?php echo 0 ?>
<?php } // Show if recordset not empty ?>
響應式網頁架站只要6,888元起|[RWD]響應式網站,自適應網頁,讓SEO搜尋引擎最佳化你的網站
"你是獵人還是獵物?"
0 comments :
張貼留言
1.猛甲茶道,歡迎多留言,可以幫自己網站打廣告~
2.需要 猛甲茶道 回覆,請勿使用匿名留言[可使用名稱/網址,名稱填自己名字,若無網址,請填E-mail]。
3.匿名攻訐、不相干之廣告適用於無條件刪去法,望請海涵:)
4.您可以使用一些 HTML 標記,如:
<b>粗體</b>, <i>斜體</i>, <a href='網址'>描述文字</a>