2011-07-25 66 views

回答

0

它單純的喜歡...

控制器:

function foo() 
{ 
    if(! empty($_POST)) 
    { 
     $hello = serialize($_POST['hello']); 
     // You can do your database abstraction here, but is better to have these in your model 
     // Btw, by using CI AR, all values are escaped automatically producing safer queries. 
     $this->db->insert('some_table', array('hello' => $hello)); 
    } 
    else 
    { 
     // do something 
    } 
} 
0

簡單:

$sSerialized = serialize($sData); 
INSERT INTO table SET field = ".myqsl_real_escape_string($sSerialized); 

我不會勸告串行數據存儲到數據庫中,但。

對於笨特定的設置,我覺得你可以看到http://codeigniter.com/user_guide/database/queries.html

+0

笨沒有連載。你有什麼建議? –