Welcome Guest, Not a member yet? Register   Sign In
Problem using a single form to create and edit (MySQL)
#1

[eluser]Unknown[/eluser]
Code:
Code:
$data = $data_db;
form_input('input',$data->input)

When editing, it's loads correctly the registry data for the input:
<input type="text" name="input" value="data" />

But when creating, error occurs. And it was to simply appear blank:
<input type="text" name="input" value="" />

Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined variable: $data


In my old code (without framework) it was simple to do:
<input type="text" name="input" value="<?=$data["input"]?>" />

When $data["input"] is null, could not mistake, just returned empty.

How to do this simple task, with CodeIgniter?
Thank you.




Theme © iAndrew 2016 - Forum software by © MyBB