Welcome Guest, Not a member yet? Register   Sign In
Hi There, some odd DB issues..
#12

[eluser]jimdoescode[/eluser]
I seem to be having the same issue. Very frustrating.

I did discover that if you call

Code:
$this->input->post(...)

for any value prior to your update it will fail with the above behavior. So even if you do something like this...
Code:
$foo = $this->input->post('foo');
if($foo)
{
  $bar = $_POST['bar'];
  $this->model->updateBar($bar, $someID);
}
bar would always get set to either NULL or 0. The work around is...
Code:
$foo = $_POST['foo'];
if($foo)
{
  $bar = $_POST['bar'];
  $this->model->updateBar($bar, $someID);
}
Something seems to be invalidating the memory location for the $_POST array when you use the post method on input. Looking at the code in libraries/Input.php I can't see what it could possibly be though that method is pretty standard stuff.

Anyway as Noy pointed out the work around is to use all $_POST values when updating you can still call
Code:
$this->input->xss_clean(...)
on the result to avoid any possible security issues.


Messages In This Thread
Hi There, some odd DB issues.. - by El Forum - 08-24-2009, 11:54 AM
Hi There, some odd DB issues.. - by El Forum - 08-24-2009, 01:37 PM
Hi There, some odd DB issues.. - by El Forum - 08-24-2009, 03:08 PM
Hi There, some odd DB issues.. - by El Forum - 08-25-2009, 01:13 AM
Hi There, some odd DB issues.. - by El Forum - 08-25-2009, 01:23 AM
Hi There, some odd DB issues.. - by El Forum - 08-25-2009, 01:38 AM
Hi There, some odd DB issues.. - by El Forum - 08-25-2009, 09:18 AM
Hi There, some odd DB issues.. - by El Forum - 08-25-2009, 09:57 AM
Hi There, some odd DB issues.. - by El Forum - 08-25-2009, 10:08 AM
Hi There, some odd DB issues.. - by El Forum - 08-25-2009, 10:22 AM
Hi There, some odd DB issues.. - by El Forum - 08-25-2009, 10:25 AM
Hi There, some odd DB issues.. - by El Forum - 09-24-2009, 12:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB