$this->db->select_max('field') - not working?!?! |
[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
[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?
[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
[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?
[eluser]einstein[/eluser]
Hi, Thank you, but i thought of upgrating after your question about the version. It works great now. Thank you |
Welcome Guest, Not a member yet? Register Sign In |