TLN_CANADA
asked on
PHP Function limit returning values
Hi all,
Here's a PHPFox script we are working on and need to alter a little bit:
All we need to do is add some code to this function so that it doesn't return the values where the user_image field is NULL. Could someone tell me how to do this?
Thank you,
D
Here's a PHPFox script we are working on and need to alter a little bit:
protected function getRows($sType = 'latest_activity')
{
switch ($sType)
{
case 'recent_signups':
return Phpfox::getLib('phpfox.database')
->select('user_image, user_name, full_name, gender')
->from(Phpfox::getT('user'))
->limit($this->iRowsLimit)
->where('view_id = 0')
->order('user_id DESC')
->execute('getRows');
break;
case 'featured':
return Phpfox::getLib('phpfox.database')
->select('user_image, user_name, full_name, gender')
->from(Phpfox::getT('user'), 'a')
->join(Phpfox::getT('user_featured'), 'b', 'a.user_id = b.user_id')
->limit($rowsLimit)
->where('view_id = 0')
->order('last_activity DESC')
->execute('getRows');
break;
case 'latest_activity':
default:
return Phpfox::getLib('phpfox.database')
->select('user_image, user_name, full_name, gender')
->from(Phpfox::getT('user'))
->limit($this->iRowsLimit)
->where('view_id = 0')
->order('last_activity DESC')
->execute('getRows');
break;
}
}
All we need to do is add some code to this function so that it doesn't return the values where the user_image field is NULL. Could someone tell me how to do this?
Thank you,
D
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
One of the PHPfox programmers suggested using "IS NOT NULL" instead in the script. Would you have any idea how to integrate this in the code?
Thank you!
D
Thank you!
D
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Ray! It's working now, as always your answers are right on the mark!
Thanks for the points and thanks for using EE. Best holiday wishes, ~Ray
ASKER
Thanks Ray, wishing you a great Christmas also!
ASKER