PHP头条
热点:

ThinkPHP非标准名称数据表快速创建模型方法


非标准名称数据表,例如:cow_archives_4,类似命名方法常见于齐博cms,08cms等文档模型数据表命名,假设已在配置文件中配置数据表前缀:

  1. return array
  2.  //'配置项'=>'配置值' 
  3.  //数据库配置 
  4.  'DB_PREFIX'=>'cow_'
  5. ); 
  6. ?> 

新建模型,Archives4Model.class.php

  1. class Archives4Model extends Model{ 
  2.      protected $tableName = 'archives_4'
  3.  } 
  4. ?> 

D方法实例化:

  1. $archives4=D("Archives4"); 
  2.  $rsdb=$archives4->select(); 
  3.  var_dump($rsdb); 

www.phpzy.comtrue/phpkj/1199.htmlTechArticleThinkPHP非标准名称数据表快速创建模型方法 非标准名称数据表,例如:cow_archives_4,类似命名方法常见于齐博cms,08cms等文档模型数据表命名,假设已在配置文件中配置数据表前缀: return arra...

相关文章

相关频道:

PHP之友评论

今天推荐