Jump to content

This topic is 7260 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello,

I am posting a list of active and inactive members. I would like to sort first by last name and then by their active status. The result would be:

Jane Doe, Active

Bob Jones, Active

Bill Adams, Inactive

How do I configure multiple sort parameters in FX.PHP? Here is my code:


// Connect to DB

$ShowAll = new FX($serverIP,$webCompanionPort);

$ShowAll->SetDBData('TheDatabase.fp7','TheLayout');

$ShowAll->SetDBPassword('xxxx','xxxx');

$ShowAll->AddSortParam('LastName','ascend');

$ShowAll->AddSortParam('ActiveFlag','descend');



// Search Parameters

$ShowAllResult=$ShowAll->FMFindAll();

So far, I can only sort by last name or by active flag, but not both. I know I could hit the db twice and return two results, but I'm hoping for a more efficient solution.

Thank you,

Shannon

-=-=-

Posted

Hello,

I am posting a list of active and inactive members. I would like to sort first by last name and then by their active status. The result would be:

Jane Doe, Active

Bob Jones, Active

Bill Adams, Inactive

How do I configure multiple sort parameters in FX.PHP? Here is my code:


// Connect to DB

$ShowAll = new FX($serverIP,$webCompanionPort);

$ShowAll->SetDBData('TheDatabase.fp7','TheLayout');

$ShowAll->SetDBPassword('xxxx','xxxx');

$ShowAll->AddSortParam('LastName','ascend');

$ShowAll->AddSortParam('ActiveFlag','descend');



// Search Parameters

$ShowAllResult=$ShowAll->FMFindAll();

So far, I can only sort by last name or by active flag, but not both. I know I could hit the db twice and return two results, but I'm hoping for a more efficient solution.

Thank you,

Shannon

-=-=-

Posted

Hello,

I am posting a list of active and inactive members. I would like to sort first by last name and then by their active status. The result would be:

Jane Doe, Active

Bob Jones, Active

Bill Adams, Inactive

How do I configure multiple sort parameters in FX.PHP? Here is my code:


// Connect to DB

$ShowAll = new FX($serverIP,$webCompanionPort);

$ShowAll->SetDBData('TheDatabase.fp7','TheLayout');

$ShowAll->SetDBPassword('xxxx','xxxx');

$ShowAll->AddSortParam('LastName','ascend');

$ShowAll->AddSortParam('ActiveFlag','descend');



// Search Parameters

$ShowAllResult=$ShowAll->FMFindAll();

So far, I can only sort by last name or by active flag, but not both. I know I could hit the db twice and return two results, but I'm hoping for a more efficient solution.

Thank you,

Shannon

-=-=-

Posted

Uhhhhh. Hmm. That worked.

I tried that before this post, but didn't realize it worked with such a small data set. I since added a dozen entries and it's more obvious.

LOL - I hope this thread at least helps someone see how FX.php can handle multiple sorts.

Thanks, Garry!

Posted

Uhhhhh. Hmm. That worked.

I tried that before this post, but didn't realize it worked with such a small data set. I since added a dozen entries and it's more obvious.

LOL - I hope this thread at least helps someone see how FX.php can handle multiple sorts.

Thanks, Garry!

Posted

Uhhhhh. Hmm. That worked.

I tried that before this post, but didn't realize it worked with such a small data set. I since added a dozen entries and it's more obvious.

LOL - I hope this thread at least helps someone see how FX.php can handle multiple sorts.

Thanks, Garry!

This topic is 7260 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.