I just have a little question about a query making me crazy. I m working with CI, and tis is the first time i m using this great framework
1— Okay so I have an insert query working rather well :
$data = array(
nom => $nom,
prenom => $prenom,
login => $prenom. .$nom,
password => facebook ,
email => $fb_data[ me ][ email ],
mobile => "00",
etat => "1",
role => "1",
ville => ville actuelle ,
facebook_id => $fb_data[ uid ],
);
$this->db->insert( membre , $data);
我不理解,为什么它总是两次插入数据......!
2— Then I got a second question : I just wanna found a user with the related facebook_id so i try that :
$this->db->select( nom );
$this->db->from( membre );
$this->db->where( facebook_id ,$fb_data[ uid ]);
$resultat=$this->db->get();
echo <pre> ;
print_r($resultat);
echo </pre> ;
我也试图:
$resultat2 = $this->db->get_where( membre ,array( facebook_id => $fb_data[ uid ]));
echo <pre> ;
print_r($resultat2);
echo </pre> ;
但在这两种情况下,唯一的一阵是:
CI_DB_mysql_result Object
(
[conn_id] => Resource id #36
[result_id] => Resource id #61
[result_array] => Array
(
)
[result_object] => Array
(
)
[custom_result_object] => Array
(
)
[current_row] => 0
[num_rows] => 1
[row_data] =>
)
因此,[结果_id]是oka,但是没有数据(只要应该用[数据]印刷?) 当我简单地尝试我方言时,右派成员就会取得正确结果。 但是,与 CI一样,它似乎没有工作。
3— Furthermore, when i Try something like that :
echo $resultat[ nom ];
它没有被视为一个阵列。
因此,我根本不理解。 如果有人能向我强调的话?