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

[eluser]Noy Gabay[/eluser]
by the way, verynewtothis and waldmeister - thanks a bunch! :-)

---------------------------------------------------

and some more new data -
if I init using $_POST (instead of the $this->input->post('Field_Name') method), it works just fine.

reminder -
Code:
echo $this->input->post('Field_Name');
prints out a valid string..

(~~oh god..~~)
#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.




Theme © iAndrew 2016 - Forum software by © MyBB