Welcome Guest, Not a member yet? Register   Sign In
on adding value in database last values is repeated as many times as rows are in table.
#1

[eluser]alberta[/eluser]
Hi all,

I have some very strange problem. I am adding a valued in database by submitting a form. After form submisstion when go back to page where the result is shown, the last value added is repeated as many time as there are total no of rows in database.

this is code in controller part code.
Code:
$query = $this->db->get_where('candidates' , array('site_id' => $site_id));
        $data['candidates'] = $query->result_array();
on view page i've this code as em using template parser.

Code:
{candidates}
    <tr>
      <td><a href='{site_url}index.php/projects/rollout_details/{pid}/{id}'>{code}</a></td>
      <td>{latitude}</td>
      <td>{longitude}</td>
      <td>{isactive}</td>      
      <td><a href='../candidate_active/{id}'>Mark as Active</a></td>
    </tr>
{/candidates}

Before adding any value result is
value of {code}
A

B
But when i add one more code like E then output is
E

E

E

Why this is happening ??


Messages In This Thread
on adding value in database last values is repeated as many times as rows are in table. - by El Forum - 05-28-2009, 03:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB