epicrecipe Posted March 16, 2005 Author Posted March 16, 2005 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 -=-=-
epicrecipe Posted March 16, 2005 Posted March 16, 2005 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 -=-=-
epicrecipe Posted March 16, 2005 Author Posted March 16, 2005 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 -=-=-
Garry Claridge Posted March 17, 2005 Posted March 17, 2005 Try it this way: $ShowAll->AddSortParam('ActiveFlag','descend'); $ShowAll->AddSortParam('LastName','ascend'); All the best. Garry
Garry Claridge Posted March 17, 2005 Posted March 17, 2005 Try it this way: $ShowAll->AddSortParam('ActiveFlag','descend'); $ShowAll->AddSortParam('LastName','ascend'); All the best. Garry
Garry Claridge Posted March 17, 2005 Posted March 17, 2005 Try it this way: $ShowAll->AddSortParam('ActiveFlag','descend'); $ShowAll->AddSortParam('LastName','ascend'); All the best. Garry
epicrecipe Posted March 18, 2005 Author Posted March 18, 2005 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!
epicrecipe Posted March 18, 2005 Author Posted March 18, 2005 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!
epicrecipe Posted March 18, 2005 Author Posted March 18, 2005 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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now