Welcome Guest, Not a member yet? Register   Sign In
Cannot test if a field is empty or not
#13

[eluser]toopay[/eluser]
Code:
return (count($result) >0 ? $result[0] :NULL);
that means, if the result more than 0, the function return first row matched
Code:
$result[0]
if not, it returns NULL. For an array result, you can just simply change
Code:
$result[0]
to
Code:
$result
at the end of your model function, and write the rest proper code at your controller to handle that array.


Messages In This Thread
Cannot test if a field is empty or not - by El Forum - 01-24-2011, 04:59 AM
Cannot test if a field is empty or not - by El Forum - 01-24-2011, 05:49 AM
Cannot test if a field is empty or not - by El Forum - 01-24-2011, 07:55 AM
Cannot test if a field is empty or not - by El Forum - 01-24-2011, 09:03 AM
Cannot test if a field is empty or not - by El Forum - 01-24-2011, 09:06 AM
Cannot test if a field is empty or not - by El Forum - 01-24-2011, 02:47 PM
Cannot test if a field is empty or not - by El Forum - 01-25-2011, 04:09 AM
Cannot test if a field is empty or not - by El Forum - 01-25-2011, 04:14 AM
Cannot test if a field is empty or not - by El Forum - 01-25-2011, 04:17 AM
Cannot test if a field is empty or not - by El Forum - 01-25-2011, 04:21 AM
Cannot test if a field is empty or not - by El Forum - 01-25-2011, 04:37 AM
Cannot test if a field is empty or not - by El Forum - 01-25-2011, 04:52 AM
Cannot test if a field is empty or not - by El Forum - 01-25-2011, 05:00 AM
Cannot test if a field is empty or not - by El Forum - 01-25-2011, 09:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB