|
datebase.php
PHP复制代码 $active_group = "default";
$active_record = TRUE;
$db['default']['hostname'] = "192.168.2.2";
$db['default']['username'] = "root";
$db['default']['password'] = "6526933";
$db['default']['database'] = "xinlian";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "gb2312";
$db['default']['dbcollat'] = "gb2312_bin";
$db['second']['hostname'] = "127.0.0.1";
$db['second']['username'] = "sa";
$db['second']['password'] = "";
$db['second']['database'] = "model";
$db['second']['dbdriver'] = "mssql";
$db['second']['dbprefix'] = "";
$db['second']['pconnect'] = TRUE;
$db['second']['db_debug'] = FALSE;
$db['second']['cache_on'] = FALSE;
$db['second']['cachedir'] = "";
$db['second']['char_set'] = "GBK";
$db['second']['dbcollat'] = "GBK"; 复制代码
module
PHP复制代码 function second_add ($biao,$arr){
$DB2 = $this->load->database('second',TRUE);
$res=$DB2->insert($biao,$arr);
if(!$res){
return $res;
$newurl=base_url ()."index.php/yichang";
header("location:$newurl");
}
else
{
return $res;
}
} 复制代码
控制器代码
PHP复制代码 function form_user()
{
$arr1['aa']="aa";
$biao="aa";
$res=$this->module->second_add($biao,$arr1);
if($res)
{
$temp['jieguo']="入库成功";
}
else
{
$temp['jieguo']="入库失败";
}
$this->load->view('admin/jieguo',$temp);
} 复制代码
什么也不显示 也不报错 |
|