Postingan lainnya
A Database Error Occurred
saya mau edit data tapi error = Unknown column 'workspace_group' in 'field list'.
ini model
function get_workspace_group($id){
$this->db->select('a.workspace_id, b.group_workspace_id, b.group_name');
$this->db->from('workspace_moredetail a');
$this->db->join('group_workspace b', 'a.workspace_group = b.group_workspace_id', 'left');
$this->db->where('a.workspace_id', $id);
$this->db->where('b.deleted', '0');
$this->db->order_by('group_workspace_id', 'asc');
$query = $this->db->get();
return $query->result_array();
}
function get_all_workspace_group($id){
$this->db->select('group_workspace_id, group_name');
$this->db->from('group_workspace');
$this->db->where('deleted', '0');
$this->db->order_by('group_workspace_id', 'asc');
$query = $this->db->get();
return $query->result_array();
}
controller
$data['workspace_group'] = $this->input->get_post('workspaceGroup');
view
<div class="col-md-6" style="padding-right:0;">
<div class="form-group">
<label>Group Workspace</label>
<select name="workspaceGroup" class="form-control">
<option value="" disabled>-- Select Noise Level --</option>
<?php
foreach ($all_workspace_group as $group){
if($group['group_workspace_id'] == $data[0]['workspace_group']){
$selected = "selected";
}else{
$selected = "";
}
echo '<option value="'.$group['group_workspace_id'].'" '.$selected.'>'.$group['group_name'].'</option>';
}
?>
</select>
</div>
</div>
0
2 Jawaban:
Jawaban Terpilih
Column (Kolom) 'workspace_group' engga ada / tidak diketahui di field list.
0
ada di database, tabel workspace_moredetail
0