[eluser]drewbee[/eluser]
No. It should not return an empty string. That is what was passed from the Form ยป 'an empty string'. Values coming from forms are always strings, even when they are numbers, so false or null are not valid options regarding this.
Your saying postgre can't save an empty string. Seems absolutely rediculous to me (remind me never to use that system);
Anyways, I did some reading and it appears you can insert a null value, but not empty. So, I would do something like this. I little bit cleaner, but still a mess. This will simply check all of your post values and convert every empty string to null. May be a good idea to just have this auto run through the form validation extension.
Code:
// Set to null if empty
foreach ($_POST AS $key => $value)
{
if (empty($value))
{
$_POST[$key] = null;
}
}
$data = array(
'table_of_contents' => $this->input->post('table_of_contents'),
'length' => $this->input->post('length'),
'lossless_copy' => $this->input->post('lossless_copy'));
);
See how that works for you.