MYSQL与Smarty的应用
在三十讲遇到这样一个问题就是运行代码时出现错误 Fatal error: Call to undefined method mysql::fetch_array() in D:\WWW\news\index.php on line 12
,我把mysql::fetch_array() 改成mysql::fetch_row() 又出现Fatal error: Call to undefined method mysql::fetch_row() in D:\WWW\news\index.php on line 12
,以至我读不到{$row[1]},具体的代码如下,
//.......smarty_inc.php
<?php
include_once("Smarty/Smarty.class.php"); //包含smarty类文件
$smarty = new Smarty(); //建立smarty实例对象$smarty
$smarty->config_dir="Smarty/Config_File.class.php"; // 目录变量
$smarty->template_dir = "./templates"; //设置模板目录
$smarty->compile_dir = "./templates_c"; //设置编译目录
$smarty->cache_dir = "./caches/"; //缓存目录
$smarty->caching = true; //开启缓存,为flase的时侯缓存无效
$smarty->cache_lifetime = 600; //缓存时间
//----------------------------------------------------
//左右边界符,默认为{},但实际应用当中容易与JavaScript相冲突
//----------------------------------------------------
$smarty->left_delimiter = "{";
$smarty->right_delimiter = "}";
?>
//......mysql_class.php
<?php
/*
* class mysql
* www.php100.com 编辑器教程
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
class mysql{
private $ho
相关问答:
Winform+MySQL做项目,在注重性能的情况下,我该如何去完成这类型的项目呢!
请各位给以提示。
你这个范围太广了,我说2点重要的吧
1.WINFORM程序是单独运行的CS程序,和BS不同,BS的压力始终都在SERVER上的,对C ......
MySql中插入当前时间的该怎么写啊?
now()
SQL code:
sql里是:
getdate()
引用
now()
学习
SQL code:
select now();
SQL code:
TODAY()
?
SQL code:
select now();
/* ......
我用的like模糊查询,比如mysql的name中有“csdn论坛系统”这几个字,如何在 <input>中查询“csdn 系统”也能出来这个“csdn论坛系统”,我现在是查“csdn”或者“系统”都可以。谢谢各位了!不知道我这么表达 ......
有一条sql语句 select a.name ,b.name from tableA a,tableB b where a.id = b.id and 。。。(其他过滤条件)
其中a.id 为tableA主键 有唯一性索引 数据量才1千多
b.id 为日志表tableB 的外键 ,慢去条件的才 ......
如题
去mysql的官网下载连接器
mysql-connector-net-6.0.3.zip
找Core Lab 的MySql 控件。功能比較好。
http://dev.mysql.com/downloads/#connector-net
SqlConnection sqlConnection = new SqlC ......