2014-10-20 2 views
0

나는 이것에 관한 사용자 가이드 및 튜토리얼을 읽었으며, 코드 점화기에서이 시점에서 새로운 Bie이므로 열심히 이해합니다. 라디오 버튼을 어떻게 확인할 수 있습니까?Codeigniter를 사용하여 데이터베이스에서 라디오 버튼을 표시하는 방법

큰 감사

여기

내 컨트롤러

public function updateProduct($id) 
 
\t { 
 
\t $data['product'] = $this->products_model->getProduct($id); 
 
    $this->load->view('update_product_view', $data); 
 
\t } 
 
\t 
 
\t public function updateProductDb() 
 
\t { 
 
\t $data=array(
 
\t \t \t \t \t 'nama'=>$this->input->post('nama'), 
 
\t \t \t \t \t 'umur'=>$this->input->post('umur'), 
 
\t \t \t \t \t 'hoby'=>$this->input->post('hoby'), 
 
\t \t \t \t \t 'jk'=>$this->input->post('jk'), 
 
\t \t \t \t \t 'alamat'=>$this->input->post('alamat')); 
 
\t \t $condition['id'] = $this->input->post('id'); 
 
\t \t $this->products_model->updateProduct($data, $condition); 
 
\t \t redirect('products'); 
 
\t \t }

here is my model 
 

 
<?php 
 
//File products_model.php 
 
\t class Products_model extends CI_Model { 
 
\t \t function __construct() { parent::__construct(); } function getAllProducts() { 
 
\t \t //select semua data yang ada pada table msProduct $this--->db->select("*"); 
 
\t \t $this->db->from("anggota"); 
 
\t \t return $this->db->get(); 
 
\t } 
 
\t 
 
\t //iNI BERFUNGSI UNTUK GET DATA YANG DI PILIH BERDASARKAN ID ATAU USER YANG KLIK */ 
 
\t function getProduct($id) 
 
\t { 
 
\t \t //select produk berdasarkan id yang dimiliki \t 
 
     $this->db->where('id', $id); //Akan melakukan select terhadap row yang memiliki productId sesuai dengan productId yang telah dipilih 
 
     $this->db->select("*"); // SELECT ALL 
 
     $this->db->from("anggota"); //TABEL 
 
     
 
     return $this->db->get(); 
 
\t } 
 
\t function addProduct($data) 
 
\t { 
 
\t //untuk insert ke database 
 
\t $this->db->insert('anggota',$data); 
 
\t } 
 
\t 
 
\t function updateProduct($data, $condition) 
 
\t { 
 
\t \t //update produk 
 
     $this->db->where($condition); //Hanya akan melakukan update sesuai dengan condition yang sudah ditentukan 
 
     $this->db->update('anggota', $data); //Melakukan update terhadap table msProduct sesuai dengan data yang telah diterima dari controller 
 
\t } 
 
\t function deleteProduct($id) 
 
\t { 
 
\t \t //delete produk berdasarkan id 
 
     $this->db->where('id', $id); 
 
     $this->db->delete('anggota'); 
 
\t } 
 
\t 
 
\t }

이이다

,333,

답변

0

당신이보기 호출하기 전에 컨트롤러를 추가,이 시도

$radio_data = array(
    'name'  => 'jk', 
    'id'   => 'jk', 
    'value'  => $detail->jk, 
    'checked'  => TRUE, 
    'style'  => 'margin:10px', 
    ); 

$data['jk']=form_radio($radio_data); 
+0

가이 아버지 <입력 유형 = "체크 박스"이름 = "HOBY"값을 사용하여 해결 될 = "Lari" hoby == "Lari") '); ?> /> 라리 \t \t \t \t \t \t \t HOBY == " Berenang ") '); ?> /> Berenang –

+0

답장을 보내 주셔서 감사합니다. mr : D –

관련 문제