\CodeIgniter_3.0.0\application\config\database.php


 


//使用sqlite

$db['default'] = array(
'dsn' => '',
'hostname' => 'sqlite:'.APPPATH.'db/ex.sqlite',
'username' => 'root',
'password' => '',
'database' => '',
'dbdriver' => 'pdo',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);


 

 

\CodeIgniter_3.0.0\application\controllers\Welcome.php



public function insert_big2() {


date_default_timezone_set('Asia/Taipei');

set_time_limit(0);//不限制執行時間



$this->db->trans_start();//開啟事務模式


$data = array(
'SID' => 'xxxx' ,
'SERIAL' => 'member' 
);
$this->db->insert('sdata', $data); //插入數據


$this->db->trans_complete();//關閉事務


 

 

 

 

 

arrow
arrow
    全站熱搜

    kinomelma 發表在 痞客邦 留言(0) 人氣()