CodeIgniter的几个问题
来源:互联网 发布:网易云课堂软件 编辑:程序博客网 时间:2024/05/01 12:17
首先遇到日期格式化显示的问题.
以前是smarty做了全部的事,所以没有注意到date()对于字符串是没有办法的.先要strtotime(),把字符串表示的日期转成日期戳,然后再用date()格式化.
另一个问题就是数据库版本的问题.
CI要求mysql 4.1以上的版本, 由于4.0及以下没有collation的变量,因此CI在设置连接校对的时候就会提示"
http://codeigniter.com/wiki/MySQL_4.0/
- Fixing it
- This is the adjustment you’ll need
to (temporarily) maketo achieve aconnection : - Open up system/database/drivers/your_driver/your_driver_driver.php Find the db_
set _charset() function, in the MySQL driver this is around line 95. Change itto say: - function db_
set _charset($charset, $collation) - {
- if($charset == false || $collation == false)
- {
- return true;
- }
- else
- {
- return @mysql_query("
SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'", $this->conn_id); - }
- }
- Then, in your database.php:
- $db['default']['char_
set '] = false; - $db['default']['dbcollat'] = false;
- With this settings, CI keeps compatibility with any version of MySQL.
- Test your
connection —you should be goodto go.
看来mysql 4.1是最低配置了.
- CodeIgniter的几个问题
- CodeIgniter的使用
- CodeIgniter 的MVC 入门
- CodeIgniter表单的验证
- CodeIgniter,smarty的使用
- codeIgniter的基本架构
- CodeIgniter的第一次接触
- CodeIgniter的扩展方法
- CodeIgniter的缓存小记
- codeigniter 的学习笔记
- CodeIgniter的源码解读
- CodeIgniter的一些实践
- codeigniter的session(1)
- codeigniter
- CodeIgniter
- codeigniter
- CodeIgniter
- CodeIgniter
- javax.naming.NameNotFoundException: Name jdbc is not bound in this Context错误待解决中
- 快速获取瑞星杀毒软件一年免费版
- 将24位BMP真彩图转换成BMP灰度图
- 浏览器还有这功能,强!!
- 字符编码问题
- CodeIgniter的几个问题
- 从装饰模式到aop
- Fedora 9 下使用apache+mongrel+rails轻松架设ROR应用
- firefox 网页部分图片无法显示
- FTP命令详解
- wince5.0 在xp64下安装
- 一小时asp入门
- 数据库设计第一范式
- 『转]用于刷新网页的javascript函数