Welcome Guest, Not a member yet? Register   Sign In
$this->db->select_max('field') - not working?!?!
#1

[eluser]einstein[/eluser]
Hi.
So according to this page:
http://ellislab.com/codeigniter/user-gui...ecord.html,
I should be able to do this:
$this->db->selectmax('user_id');
$query = $this->db->get("tblusers");
(this code is from my model)
But i get this error:
Call to undefined function: select_max()
Active record is not turned off. I tryed also selectmax() but no luck,
Any suggestions?
Thank you
#2

[eluser]Pascal Kriete[/eluser]
[quote author="einstein" date="1212178847"]
$this->db->selectmax('user_id');
$query = $this->db->get("tblusers");
[/quote]

I assume that's just a typo. What version of CI are you running?
#3

[eluser]einstein[/eluser]
Hi,
No is not a typo i had the same problem with get_where where get_where dose not work as it should but getwhere works like a charm,
My version is: 1.5.4.
This is what i have now:
$this->db->select_max('user_id');
$query = $this->db->get("tblusers");
This is my error: Fatal error: Call to undefined function: select_max() in /home.....

Thank you
#4

[eluser]Michael Wales[/eluser]
Maybe select_max() was added after 1.5.4 (I don't feel like diving into docs to find when it was added). Since the documentation you are referring to is for 1.6.2, might I suggest upgrading?
#5

[eluser]einstein[/eluser]
Hi,
Thank you, but i thought of upgrating after your question about the version.
It works great now.

Thank you




Theme © iAndrew 2016 - Forum software by © MyBB