Welcome Guest, Not a member yet? Register   Sign In
Duplicate Entry DB error (any clues)?
#4

[eluser]Hakkam[/eluser]
In your table no need add a column anyway.
You just retrieve EmplodeID and put in input type form EmployeID_orig and in input type form EmployeID. And than when you will update db, the input type EmployeID_orig as in Where condition.

<?php foreach($query->result() as $row):?>

<p>Employee ID_Origin:<br>&lt;input type='text' value=&lt;?=$row-&gt;employeeID;?&gt; name='employeeID_Origin'></p>
<p>Employee ID:<br>&lt;input type='text' value=&lt;?=$row-&gt;employeeID;?&gt; name='employeeID'></p>

And in controller :
In controller :

function update_emp()
{
$this->load->database();

$this->db->set(‘employeeID’,$_POST[‘employeeID’]);
$this->db->where(‘employeeID’,$_POST[‘employeeID_Origin’]);
$this->db->update(‘tblemployee’);


Messages In This Thread
Duplicate Entry DB error (any clues)? - by El Forum - 07-16-2009, 12:16 AM
Duplicate Entry DB error (any clues)? - by El Forum - 07-16-2009, 01:24 AM
Duplicate Entry DB error (any clues)? - by El Forum - 07-16-2009, 01:41 AM
Duplicate Entry DB error (any clues)? - by El Forum - 07-16-2009, 01:50 AM
Duplicate Entry DB error (any clues)? - by El Forum - 07-16-2009, 02:06 AM
Duplicate Entry DB error (any clues)? - by El Forum - 07-16-2009, 02:24 AM
Duplicate Entry DB error (any clues)? - by El Forum - 07-16-2009, 02:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB