Welcome Guest, Not a member yet? Register   Sign In
how to display data from the db in html tables dynamically?
#3

[eluser]InsiteFX[/eluser]
Code by Adam Griffiths Auth 1.0.6
Code:
// --------------------------------------------------------------------

/**
  * manage()
  *
  * Description:
  *
  * @access public
  * @param string
  * @return void
  */
public function manage()
{
  // Grab an array of users from the database
  $data = $this->users->users();

  // Setting headings for the table
  $this->table->set_heading('Username', 'Email', 'Actions');
  
  foreach($data as $value => $key)
  {
   // Build actions links
   $actions = anchor("admin/users/edit/".$key['id']."/", "Edit") . anchor("admin/users/delete/".$key['id']."/", "Delete");

   // Adding row to table
   $this->table->add_row($key['username'], $key['email'], $actions);
  }

  // Load the Auth specific view
  $this->auth->view('users/manage');
}

Should show you how to do it.


Messages In This Thread
how to display data from the db in html tables dynamically? - by El Forum - 08-05-2012, 03:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB