Welcome Guest, Not a member yet? Register   Sign In
Callbacks
#4

[eluser]cideveloper[/eluser]
first of all there is no reason for you to pull the entire table and then loop through it. That is just bad practice. You should only select things you are looking for.

Code:
$this->db->select('email')->where('email', $email)->get('realtors',1);

secondly your true/false will always return true unless the email address is the last email in the table. See example below

loop 1 - $email!=$row->email - true
loop 2 - $email!=$row->email - true
loop 3 - $email==$row->email - false
loop 4 - $email!=$row->email - true
loop 5 - $email!=$row->email - true

then you return the last. As you can see this will never work unless the email address is the last email in the table.
loop 6 - $email!=$row->email - true


Messages In This Thread
Callbacks - by El Forum - 06-09-2011, 04:36 PM
Callbacks - by El Forum - 06-09-2011, 07:09 PM
Callbacks - by El Forum - 06-09-2011, 08:30 PM
Callbacks - by El Forum - 06-09-2011, 11:01 PM
Callbacks - by El Forum - 06-12-2011, 05:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB