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

[eluser]crispinatari[/eluser]
Thnaks for the reply!! does that mean i have to make a new column in my table called employeeID_Origin?

so here is the form view: does this mean i do this to the form?

Code:
<html>
<head>
<title><?=$title?></title>
<link rel="stylesheet" type="text/css" href="employee.css" />
</head>
<body>
<h1></h1>

    
<h3>Edit Employee Details</h3>    


&lt;form action="http://localhost/ci1/index.php/emps/update_emp" method="post"&gt;
&lt;?//or using form helper //=form_open('blog/insertentry');?&gt;

&lt;?php if($query->num_rows()==1):?&gt;
&lt;?php foreach($query->result() as $row):?&gt;

<p>Employee ID_Origin:<br>&lt;input type='text' value=&lt;?=$row-&gt;employeeID_Origin;?&gt; name='employeeID_Origin'></p>
<p>Employee ID:<br>&lt;input type='text' value=&lt;?=$row-&gt;employeeID;?&gt; name='employeeID'></p>
<p>Department ID:<br>&lt;input type='text' value=&lt;?=$row-&gt;departmentID;?&gt; name='departmentID'></p>
<p>First Name:<br>&lt;input type='text' value=&lt;?=$row-&gt;first_name;?&gt; name='first_name'></p>
<p>Last Name:<br>&lt;input type='text' value=&lt;?=$row-&gt;last_name;?&gt;  name='last_name'></p>
&lt;?php endforeach;?&gt;
<p>&lt;input type='submit' value='update' &gt;&lt;/p>
&lt;?php else:?&gt;
&lt;?php echo"error";?&gt;
&lt;?php endif;?&gt;

&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

and list view:
Code:
&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;Display All Employees&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

<center>
&lt;form action="http://localhost/ci1/index.php/home/index" name="button2" align="left"&gt;
  &lt;INPUT type="submit" value="Back to Home"/&gt;
&lt;/form&gt;

  <br>
&lt;form action="http://localhost/ci1/index.php/side_menu/emps_add_page" name="button1" align="right"&gt;
  &lt;INPUT type="submit" value="Add Employee"/&gt;&lt;br>
&lt;/form&gt;
</center>

<br>

&lt;?//if using url helper//=anchor('emps/addemp','Add Employee');?&gt;

<table class="emps" width="57%" border="1" cellspacing="0" cellpadding="0" align="center">
<tr>
<th>Employee ID</th>
<th>Department ID</th>
<th>Employee First Name</th>
<th>Employee Last Name</th>

</tr>
&lt;?php foreach($res as $row): ?&gt;
    <tr>
    <td class="employeeID">&lt;?=$row->employeeID?&gt;</td>
    <td>&lt;?=$row->departmentID?&gt;</td>
    <td >&lt;?=$row->first_name?&gt;</td>
    <td >&lt;?=$row->last_name?&gt;</td>
  
    <td>&lt;?=anchor('emps/editemp/'.$row->employeeID,'Edit');?&gt;</td>
    <td>&lt;?=anchor('emps/deleteemp/'.$row->employeeID,'Delete');?&gt;</td>
    
    </tr>
&lt;?php endforeach; ?&gt;
</table>

</div>
<br><br>

&lt;/body&gt;
&lt;/html&gt;


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