Welcome Guest, Not a member yet? Register   Sign In
this db select_max error
#1

[eluser]Pedro Luz[/eluser]
Hi,
can anyone explain to me, why when i run this code:

Code:
$this->db->select_max('id');
$q = $this->db->get($this->tableName);
return $q->row();

I get this error:

Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 0
Filename: database/DB_active_rec.php
Line Number: 1719

thanks
#2

[eluser]pickupman[/eluser]
Just tried the same syntax without issue. Have you my chance ever edited this file? I am looking at the lastest source from bitbucket, and at that line I see a foreach loop for select statements.
#3

[eluser]Pedro Luz[/eluser]
hi,
this is what i have in that line:

Code:
$this->ar_select[$key] = $this->_protect_identifiers($val, FALSE, $this->ar_no_escape[$key]);

i never edited that file
#4

[eluser]toopay[/eluser]
Maybe the error is come from another line of your model function.
#5

[eluser]pickupman[/eluser]
What happens if right above that line you try var_dump($key); it seems like it maybe empty.
#6

[eluser]deadelvis[/eluser]
I think this has been patched already?
https://bitbucket.org/ellislab/codeignit...ile_select




Theme © iAndrew 2016 - Forum software by © MyBB