Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] delete row
#9

[eluser]maria clara[/eluser]
here is my controller (it is in switch but i will just show you the delete case):


Code:
function detailpost()
    {

        $crudColumns =  array(
            'id'=>'company_id'
            ,'company_code'=>'company_code'
            ,'company_name'=>'company_name'
        );
        $crudTableName = 'erp_maint_company';
        $postConfig['id'] = 'company_id';

        
        $postConfig['action'] = 'oper';             /* action variable */
    keyword *//* set to be the same as action keyword for default */
        $crudConfig['create'] = 'add';                /* action CREATE keyword */
        $crudConfig['update'] = 'edit';                /* action UPDATE keyword */
        $crudConfig['delete'] = 'del';                /* action DELETE keyword */
        $crudConfig['totalPages'] = 'total';        /* total pages */
        $crudConfig['totalRecords'] = 'records';    /* total records */
        

foreach ($postConfig as $key => $value){
            if(isset($_REQUEST[$value])){
                $postConfig[$key] = fnCleanInputVar($_REQUEST[$value]);
            }

/*some other case statement here*/

case $crudConfig['delete']:
                #print_r($_POST);
                $this->db->where('company_id', $this->input->post('id'));
                $this->User->delete($crudTableName);
                //$this->db->delete($crudTableName);
            }


here's my model (will show you just the function concerning the delete)

Code:
function delete($data) //Query function use to delete user
    {
        
        $deleted_row = $data['company_code'];
        
        //$data['is_deleted'] = '1';
        $this->db->where('company_id', $data['company_id']);
        $this->db->update('maint_company', $data);  //<------ even if i use the set in replace of update
    
        $this->db->where('user_id', $data['user_id']);
        $this->db->update('sec_companyaccess', $data); //<------ even if i use the set in replace of update
        
        return $deleted_row;
        
    }


Messages In This Thread
[SOLVED] delete row - by El Forum - 02-15-2010, 08:49 PM
[SOLVED] delete row - by El Forum - 02-15-2010, 09:33 PM
[SOLVED] delete row - by El Forum - 02-15-2010, 10:02 PM
[SOLVED] delete row - by El Forum - 02-15-2010, 10:09 PM
[SOLVED] delete row - by El Forum - 02-15-2010, 11:43 PM
[SOLVED] delete row - by El Forum - 02-15-2010, 11:50 PM
[SOLVED] delete row - by El Forum - 02-15-2010, 11:57 PM
[SOLVED] delete row - by El Forum - 02-16-2010, 12:03 AM
[SOLVED] delete row - by El Forum - 02-16-2010, 12:09 AM
[SOLVED] delete row - by El Forum - 02-16-2010, 12:26 AM
[SOLVED] delete row - by El Forum - 02-17-2010, 08:04 PM
[SOLVED] delete row - by El Forum - 02-17-2010, 08:49 PM
[SOLVED] delete row - by El Forum - 02-17-2010, 09:00 PM
[SOLVED] delete row - by El Forum - 02-17-2010, 10:12 PM
[SOLVED] delete row - by El Forum - 02-17-2010, 10:54 PM
[SOLVED] delete row - by El Forum - 02-18-2010, 12:37 AM
[SOLVED] delete row - by El Forum - 02-18-2010, 12:54 AM
[SOLVED] delete row - by El Forum - 02-18-2010, 09:32 AM
[SOLVED] delete row - by El Forum - 02-21-2010, 07:09 PM
[SOLVED] delete row - by El Forum - 02-22-2010, 01:22 AM
[SOLVED] delete row - by El Forum - 02-22-2010, 01:28 AM
[SOLVED] delete row - by El Forum - 02-22-2010, 02:42 AM
[SOLVED] delete row - by El Forum - 03-03-2010, 01:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB