php框架

 首页 > php框架 > ThinkPHP > TP config.php改变之后 - Thinkphp

TP config.php改变之后 - Thinkphp

分享到:
【字体:
导读:
          如果改变了conf config php文件中的配置信息,那么需要删掉runtime ~runtime php,否则:会出现系统信息错误 比如我在配置完数据库信息后:?ph...

TP config.php改变之后

如果改变了conf/config.php文件中的配置信息,那么需要删掉runtime/~runtime.php,否则:会出现系统信息错误.

比如我在配置完数据库信息后:

  1. if (!defined('THINK_PATH')) exit(); 
  2. return array
  3. 'DB_TYPE'=>'mysql'// 使用的数据库是mysql 
  4. 'DB_HOST'=>'localhost'
  5. 'DB_NAME'=>'myapp',// 数据库名 
  6. 'DB_USER'=>'root'
  7. 'DB_PWD'=>'yzw',// 填写你连接数据库的密码 
  8. 'DB_PORT'=>'3306'
  9. 'DB_PREFIX'=>'think_'// 数据表表名的前缀 请参看http://thinkphp.cn/Article/10 
  10. ); 
  11. ?> 

信息一直刷不出来,直到我删除了~runtime.php之后就好了:

  1. public function index() { 
  2.     //$this->assign('str',"hello "); 
  3.      //$this->display(); 
  4.       $Form = D("Form"); 
  5.       $result  = $Form->findAll(); 
  6.       dump($result); 
  7.   } 

然后输出的信息为:

  1. array(1) { [0] => array(7) { ["id"] => string(1) "1" ["title"] => string(18) "这是测试数据" ["content"] => string(4) "dfdf" ["create_time"] => string(10) "1212724876" ["update_time"] => string(1) "0" ["status"] => string(1) "1" ["email"] => string(12) "dddd@ddd.com" } } 
分享到:
ThinkPHP3.0国际化配置方法 - Thinkphp
ThinkPHP3.0国际化配置方法 TP3.0的国际化和2.x的配置方法有一些区别,如果你仅仅下的是核心文件我们需要在ThinkPHP/Extend/Behavior文件夹下导入CheckLangBehavior.class.php文件,这个文件完整版本里有,然后需要在Conf文件夹下新建tags.php文件内容为:   在Long文件夹下新建两个...
thinkphp用法小记 - Thinkphp
thinkphp用法小记 (1) (2) (3)显示数据   编号:{$vo.id}  难易程度:{$vo.NanYiChengDu}  试题内容:{$vo.contnet}      (A){$vo.chioce_A}  (B){$vo.chioce_B}  (C){$vo.chioce_C}  (D){$vo.chioce_D}        (4)根据id号来编辑和删除数...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……