[eluser]a.somervell[/eluser]
Heya, anyone got an intelligent answer to this, its escaping me:
I'm doing a simple profile management form for an account
In my form i've got
Code:
<input type="text" name="first_name" value="<?=set_value("first_name",$account['first_name'])?>" />
first_name is obviously the field name (and database field name), if I don't see a post I grab the defaults from the database and pass the row_array() to the $account variable in the view.
If someone goes in and theres no first_name in the database $account['first_name'] isn't set and I get a php notice that it is undefined.
Now, I could ignore notices or go...
Code:
$account['first_name'] = (isset($account['first_name']) ? $account['first_name'] : "";
... for every bloody line, but i'd rather just have a simple solution and there's *gotta* be one in PHP I just dont know about?