Fatal error: Call to undefined method CI_DB_mysql_driver::row()? |
[eluser]anna16[/eluser]
guys i have this error below, Code: Fatal error: Call to undefined method CI_DB_mysql_driver::row() here is the codes again, Code: <?php I'm lost thanks in advanced.
[eluser]TaylorOtwell[/eluser]
It doesn't look like you're calling the "get()" method in your "check_email()" function, so the query you are defining is never actually executing. Try this: Code: $query = $this->db->select('email')->where('email', $this->input->post('email'))->get();
[eluser]anna16[/eluser]
thanks for the hint i guess i got it, Code: function check_email()
[eluser]TaylorOtwell[/eluser]
That still doesn't actually execute the query does it?
[eluser]anna16[/eluser]
yeah, why is it not accepting this codes below, function check_email() { $query = $this->db ->select('email') ->from('user') ->where('email', $this->input->post('email')); return $query->result(); } it says, Code: Fatal error: Call to undefined method CI_DB_mysql_driver::result()
[eluser]dudeami0[/eluser]
The problem is you never actually execute the query. It's like setting up the string "SELECT `email` FROM `users` WHERE `email` = ?" but never sending it to the DB. The get() function executes the query, so you need: Code: function check_email() {
[eluser]anna16[/eluser]
@dudeami0 Thank you very much, you are a <b>BIG</b> help. It is working now. My question is why is 'from' doesn't work? Thanks in advanced.
[eluser]dudeami0[/eluser]
The from function does work, but it just adds the "from" to the query. So you could do Code: function check_email() { And it would work. Select(), from(), and where() are all used to build the query. get(), insert(), and update() execute queries based on what you gave it with select, from, and where before calling them.
[eluser]InsiteFX[/eluser]
Hi anna, This is all in the CodeIgniter User Guide Active Record. Active Record Class InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |