Smarty从数据库中提取图片显示到页面(实例)
来源:互联网 发布:软件询价函 编辑:程序博客网 时间:2024/06/10 13:30
PHP 文件:
<?php
include("libs/Smarty.class.php");
$smarty=new Smarty();
$smarty->template_dir="demo/templates";
$smarty->compile_dir="demo/templates_c";
$smarty->left_delimiter="<{";
$smarty->right_delimiter="}>";
$smarty->config_dir="demo/config";
//$smarty->caching=true;//开启缓存
//$smarty->cache_dir="../demo/cache";//缓存文件存放的路径
$array2=array();
mysql_connect("localhost","root","123");
mysql_select_db("fanyi");
mysql_query("set names utf8");
$q="select * from tupian order by id desc limit 1 ";
$result=mysql_query($q);
while($row=mysql_fetch_assoc($result)){
$array2[]=$row;
}
//print_r ($array2);
$smarty->assign("array2",$array2);
$smarty->display("huoban.tpl");
?>
TPL文件:
<div id="articeBottom">
<{section name=new loop=$array}>
<{$array[new].content}>
<{/section}>
</div><p>
<{section name=n loop=$array2}>
<img alt="" src="../../../fanyi/admin/<{$array2[n].logo}>" border="0">
<{/section}>
</p></div>
- Smarty从数据库中提取图片显示到页面(实例)
- WPF中把图片保存到数据库,并且从数据库提取出来显示
- WPF中把图片保存到数据库,并从数据库提取出来显示
- struts保存图片到数据库 ,从数据库中读取图片显示到页面
- PHP从页面上传图片到数据库(实例)
- 从数据库提取显示页面
- Smarty如何从数据库读取图片(实例)
- 数据库存储BloB格式图片,并从数据库中取出显示到页面中
- 用Seam实现:图片上传 + 保存到数据库 + 从数据库读出图片并显示到页面中
- 用Seam实现:图片上传 + 保存到数据库 + 从数据库读出图片并显示到页面中
- 图片显示在页面,从数据库提取图片并限制图片的大小
- javaweb上传图片,并且从数据库中查出,在页面显示,同时保存图片到数据库中
- SpringMVC从数据库中读取图片显示到JSP页面上
- SpringMVC从数据库中读取图片显示到JSP页面上
- 图片以二进制形式存到数据库中,并从数据库中读出显示在页面上
- 如何从数据库调出数据显示到页面PHP+Mysql+Html(简单实例)
- 如何从数据库调出数据显示到页面 PHP+Mysql+Html(简单实例)
- 从数据库调出数据显示到页面 PHP+Mysql+Html(简单实例)
- 初步《软工》思考
- c++各种内置类型字节大小
- java爬虫返回页面乱码问题
- tomcat在Debug模式下无法启动解决办法
- fatal error C1083: 无法打开包括文件:“iostream.h”: No such file or directory
- Smarty从数据库中提取图片显示到页面(实例)
- UVa 10608 - Friends
- 最近看LuaPlus发现的一个很好的Blog
- C++拷贝构造函数详解
- 云风谈程序员的职业素养
- 在VS8里面 fatal error C1083: 无法打开包括文件:“iostream.h”: No such file or directory
- 学到了
- vim+Taglist+cscope+ctags
- 基于C文件操作