Home > Backend Development > PHP Tutorial > 模板赋值assign解决方法

模板赋值assign解决方法

WBOY
Release: 2016-06-13 13:24:32
Original
831 people have browsed it

模板赋值assign

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->$connect = mysql_connect('127.0.0.1', 'root', '123456');
mysql_select_db('456789', $connect);
mysql_query('set names gbk');
$sql = "select code from shop";
$query = mysql_query($sql);
$carts = array(
    'orders_id' => $cart->OrdersId,
    'cart_count' => $cart->cartCount(),
    'price_count' => $cart->priceCount()
);
$dtp = new DedeTemplate();
$dtp->Assign('carts',$carts);
$dtp->LoadTemplate(_PLUS_TPL_.'/car.htm');
$dtp->Display();
exit;
Copy after login


为何在模板car.htm中使用没能输出查询到的结果?

------解决方案--------------------
'price_count' => $cart->priceCount(), 后面是全角逗号。改为英文逗号即可。
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template