Welcome Guest, Not a member yet? Register   Sign In
Validation
#2

[eluser]Michael Wales[/eluser]
You would select that data from your database and pass it to the view - just like you would any other data.

Controller:
Code:
$query = $this->db->select('username')->getwhere('users', array('id'=>'1'), 1, 0);
if ($query->num_rows() == 1) {
  $row = $query->row();
  $this->data->user->username = $row->username;
}

View:
Code:
<p><label for="username">Username:</label><br />
&lt;input type="text" name="username" value="&lt;?= $user-&gt;username; ?&gt;" size="50" /></p>


Messages In This Thread
Validation - by El Forum - 10-22-2007, 12:04 PM
Validation - by El Forum - 10-22-2007, 01:24 PM
Validation - by El Forum - 10-22-2007, 02:07 PM
Validation - by El Forum - 10-22-2007, 02:21 PM
Validation - by El Forum - 10-22-2007, 03:01 PM
Validation - by El Forum - 10-22-2007, 03:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB