Smarty操作数据库

来源:互联网 发布:工商银行数据中心 编辑:程序博客网 时间:2024/06/05 17:48
<?php
include("libs/Smarty.class.php");
 
$link=mysql_connect('localhost','root','123');
mysql_select_db('is_ecshop',$link);
mysql_query("set names utf8");


$sql="select brand_name from brand where id = '".$_POST['text']."'";
$result=mysql_query($sql);
@$row=mysql_fetch_row($result);
$a=new Smarty();
 $a->template_dir ="demo/templates";
 $a->compile_dir="demo/templates_c";
 $a->config_dir="demo/conf";
 $a->left_delimiter="<{";
 $a->right_delimiter="}>";
 $a->assign('text',$row);
 $a->assign('dp',$_POST['py']);
 $a->display("float.tpl");
原创粉丝点击