`
piperzero
  • 浏览: 3473463 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

thinkPHP错误多

 
阅读更多

1thinkphp指定其他数据库

系统:win xp

wamp:2.1 (php5.3.5+apache2.2.17+mysql5.5.8)
thinkphp:2.1
--------------------------------------------------
[db]
host:127.0.0.1
name:test
user:root
password:123456

[Action/TestAction.class.php]
class TestAction extends Action{
<wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">public function index() {</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">$m_test = D('WzgTest');</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">$rs = $m_test-&gt;field('user_id')-&gt;select();</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">var_dump($rs);</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">}</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">}</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="word-wrap:normal; word-break:normal; line-height:21px; color:rgb(70,70,70); font-family:simsun; font-size:14px; background-color:rgb(188,211,229)"><strong>[model/WzgTestModel.class.php]</strong></span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">class WzgTestModel extends Model {</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">protected $connection = "mysql://root:123456@127.0.0.1:3306/test";</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">protected $trueTableName = 'wzg_test';</span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">}</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">--------------------------------------------------</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="word-wrap:normal; word-break:normal; line-height:21px; color:rgb(70,70,70); font-family:simsun; font-size:14px; background-color:rgb(188,211,229)"><strong>thinkphp相关代码</strong></span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">(1)ThinkPHP/Lib/Think/Core/Model.class.php</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">(2)ThinkPHP/Lib/Think/Db/Db.class.php</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="word-wrap:normal; word-break:normal; line-height:21px; color:rgb(70,70,70); font-family:simsun; font-size:14px; background-color:rgb(188,211,229)"><strong>thinkphp发现的bug</strong></span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">(1)ThinkPHP/Lib/Think/Db/Db.class.php 321行</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">原代码</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">preg_match('/^(.*?)\:\/\/(.*?)\:(.*?)\@(.*?)\:([0-9]{1, 6})\/(.*?)$/',trim($dsnStr),$matches);</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">更改后(“{1, 6}”之间的空格去掉)</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><p><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">preg_match('/^(.*?)\:\/\/(.*?)\:(.*?)\@(.*?)\:([0-9]{1,6})\/(.*?)$/',trim($dsnStr),$</span><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">matches);</span></p> <p><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)"><br></span></p> </wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
分享到:
评论

相关推荐

    ThinkPHP_错误调试和日志.chm

    ThinkPHP_错误调试和日志.chm

    thinkphp上传错误解决方法

    thinkphp上传错误解决方法

    ThinkPHP3.1.3完整包

    ThinkPHP3.1.3版本相对于上一版本更加安全和易用,是一个建议升级的版本。 更新 该版本针对3.1.2进行了一些改进和完善,主要包括: 改进异常处理,支持致命错误捕获; 针对PDO驱动和Sqlsrv驱动的完善,支持参数...

    ThinkPHP中自定义错误页面和提示页面实例

    本文实例讲述了ThinkPHP中自定义错误页面和提示页面的方法。分享给大家供大家参考。具体实现方法如下: 在ThinkPHP中有两个方法时提示错误页面 _404(‘错误信息’,’跳转的地址’);halt(‘提示信息’); 这两个函数都...

    thinkphp6 通过命令行快速生成多应用模块报 【Command “build” is not defined.】错误的解决办法

    报如下图错误 解决办法: 1.查看官方文档: https://www.kancloud.cn/manual/thinkphp6_0/1037643 文档里说: 所以我命通过命令安装扩展: composer require topthink/think-multi-app 出现如下图说明安装成功了...

    ThinkPHP2.1 常见问题&开发技巧

    ThinkPHP2.1 常见问题&开发技巧

    ThinkPHP5.0完全开发手册

    ThinkPHP5.0版本是一个颠覆和重构版本,采用全新的架构思想,引入了更多的PHP新特性,优化了核心,减少了依赖,实现了真正的惰性加载,支持composer,并针对API开发做了大量的优化,包括路由、日志、异常、模型、...

    thinkPhp 资料大全---下载不扣分,回帖加1分,欢迎下载,童叟无欺

    ThinkPHP 错误调试和日志.chm ThinkPHP-2.0-API.chm ThinkPHP1.6.0RC1快速入门.chm ThinkPHP2.0完全开发手册(1).chm ThinkPHP2.0完全开发手册.chm ThinkPHP2.0完全开发手册.pdf ThinkPHP2.0完全开发手册.swf ...

    TOPTP v1.0纯净版(for ThinkPHP2.1RC1)-ThinkPHP代码生成器

    ThinkPHP目录层次太多。 配置一个分组后,要在lib/Action下建立分组文件夹,又要在Tpl/default下建立分组文件夹。每建立一个模块 (Action文件)又要再相应的分组目录下面建立模块文件夹,在日常写程序的时候往往你...

    极光推送demo thinkphp

    极光推送demo thinkphp,欢迎大家前来下载,如果错误,请留言

    ThinkPHP v5.0.24 完整版.zip

    ThinkPHP借鉴了国外很多优秀的框架和模式,使用面向对象的开发结构和MVC模式,采用单一入口模式等,融合了Struts的 Action思想和JSP的TagLib(标签库)、RoR的ORM映射和ActiveRecord模式,封装了CURD和一些常用操作,...

    毕业设计-基于thinkphp+layui的进销存系统(源代码+说明)

    进销存系统,基于thinkphp+layui开发。功能包含:采购、销售、零售、多仓库管理、财务管理等功能 和超详细的报表功能(采购报表、销售报表、零售报表、仓库报表、资金报表等)。 系统在生活中的应用十分广泛,无论是...

    ThinkPHP完全帮助文档

    ThinkPHP配置指南和参考.chm ...ThinkPHP多语言的使用和配置.chm ThinkPHP多元化缓存机制.chm ThinkPHP类库导入和自动加载.chm ThinkPHP模板指南.chm ThinkPHP数据操作指南.chm API帮助文档: ThinkPHP-2.0-API.chm ....

    ThinkPHP提示错误Fatal error: Allowed memory size的解决方法

    本文实例讲述了ThinkPHP提示错误Fatal error: Allowed memory size的解决方法。分享给大家供大家参考。具体分析如下: 如果你的ThinkPHP提示你:致命错误(Fatal error: Allowed memory size),根据网上说的提高...

    TP5(thinkPHP5框架)实现显示错误信息及行号功能的方法

    主要介绍了TP5(thinkPHP5框架)实现显示错误信息及行号功能的方法,结合实例形式分析了thinkPHP5显示错误信息及行号的相关配置文件与设置修改方法,需要的朋友可以参考下

    thinkphp+swfupload实现豆瓣相册上传图片效果

    thinkphp+swfupload实现豆瓣相册上传图片效果 加上RBAC后,在FF跟CHROME下,会报错 上传方法是否被RBAC给拦住了,还有如果要调试建议在...

    ThinkPHP下表单令牌错误与解决方法分析

    主要介绍了ThinkPHP下表单令牌错误与解决方法,较为详细的分析了thinkPHP表单令牌的原理、配置、错误原因与相应的解决方法,需要的朋友可以参考下

    thinkphp装修网站

    这是一个由thinkphp开发的装修官网。1.如何安装? 答:你的域名/install 按提示一步步安装,数据库地址填写你的数据库地址 2.后台地址? 答:你的域名/admin 程序安装完 后台默认 账号:admin 密码:admin888 3....

Global site tag (gtag.js) - Google Analytics