Waseem shah
Waseem shah

Reputation: 450

How to delete specific column in a row in codeigniter

I need the following code in codeingiter.

mysql_query("DELETE `father_name` FROM `table` WHERE `id`='$id'");

So that on father name delete from the row not the whole row. Thanks in advance.

Upvotes: 0

Views: 3392

Answers (1)

Vimal
Vimal

Reputation: 1146

Done in codeigniter like this.

$data = array('father_name' => 'NULL');
$this->db->where('id', $id);        
$this->db->update('table', $data);

Upvotes: 3

Related Questions