Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Sorting a Multidimensional Array with PHP and usort

    Issues with previous code. Problem solved!

    Mod can delete this thread.
    Last edited by bcarter755; 02-12-2013 at 03:52 AM.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,523
    Thanks
    8
    Thanked 1,091 Times in 1,082 Posts
    I'm going to throw out this idea ... and realize I don't have an answer to your specific array situation. I think it would be a good idea to post your question in the MySQL section of this forum. Something in my gut tells me that most of what you're doing can actually be handled by the query itself. MySQL is way more powerful than many people give it credit for ... and someone with a lot of MySQL experience might be able to give you the definitive answer.

  • #3
    New Coder
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts
    mlseim, thanks for the suggestion. I hadn't considered the possibility of doing some of the sorting through MySQL.

    I'm going to leave this thread on here for a few days to see if anyone has any ideas to get my script working. I'd really like to figure out how to do this through PHP.

    If nobody has an idea on whether/how it's possible, I'll try in the MySQL section of the forums.

    Thanks again for the help everyone—I'm looking forward to hearing any suggestions for the script!

  • #4
    New Coder
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I took a different approach and figured it out.

    I'm using the MySQL to get unique dates to take that factor out of the sorting equation. It's much simpler now.

    Thanks!

    (A Mod can delete this thread as it's no longer relevant.)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •