#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    32
    Rep Power
    14
    Alright, basically what I'm doing is ranking people based on a certain element compared by in mysql. What I want to do is use the query "SELECT Element FROM table WHERE Key='Keyvalue' ORDER BY Element" then determine the index of that index. But since mySQL returns an associative array, I can think of anyway to do this without searching the array which would slow down the load time considerably. Anybody got an idea, like a function that'll do this?
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    Your post isn't very clear. What do you mean by "index of that index?"

    Also, mysql doesn't "return an associative array." MySQL returns a result set which PHP can interpret into just about anything you want, associative arrays being just one way.

Similar Threads

  1. C++ programming help.
    By Programming1 in forum C Programming
    Replies: 1
    Last Post: January 20th, 2004, 10:47 AM
  2. char array index position
    By DirkPitt in forum C Programming
    Replies: 2
    Last Post: January 8th, 2004, 08:39 PM
  3. Checkbox, array index ?
    By stojan in forum HTML Programming
    Replies: 2
    Last Post: January 5th, 2004, 03:05 PM
  4. Sort with two dimensional associative array
    By hamutaro in forum PHP Development
    Replies: 3
    Last Post: December 29th, 2003, 07:57 PM
  5. getting the elements[] array index using "this"
    By crustymonkey in forum HTML Programming
    Replies: 3
    Last Post: December 21st, 2003, 04:03 PM

IMN logo majestic logo threadwatch logo seochat tools logo