Link to home
Start Free TrialLog in
Avatar of TLN_CANADA
TLN_CANADAFlag for Afghanistan

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:

 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;

                }
        }

Open in new window



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
Avatar of wadehults
wadehults
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TLN_CANADA

ASKER

Thank you, for some reason this isn't working though.
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
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Thanks Ray, wishing you a great Christmas also!