WEB MySQL statement

Discussion in 'OT Technology' started by hurleyint1386, Nov 12, 2007.

  1. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    I'm working on a MySQL query, and i want to select everything but with a position of "A", "B", "C", "D", "E", "F" anyone?
     
  2. TheDarkHorizon

    TheDarkHorizon \xC0\xFF\xEE

    Joined:
    Sep 26, 2002
    Messages:
    2,396
    Likes Received:
    0
    Location:
    San Francisco, CA
    I'm not clear what you're asking. Do you want to select the fields in alphabetical order? If that's the case, what is your reasoning for needing that?
     
  3. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    the table has a column named "position"

    what i need to do is select every record in the table that does not have one of the positions listed above. any other position is fine
     
  4. TheDarkHorizon

    TheDarkHorizon \xC0\xFF\xEE

    Joined:
    Sep 26, 2002
    Messages:
    2,396
    Likes Received:
    0
    Location:
    San Francisco, CA
    WHERE position NOT IN ('A', 'B', 'C', 'D', 'E', 'F')
     
  5. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    I'll definitely try this when i get a chance
     
  6. noon

    noon get high and teach me how to listen

    Joined:
    May 4, 2002
    Messages:
    3,384
    Likes Received:
    0
    Location:
    Lawrence, KS
    .
     
  7. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    I'm still having a little trouble. Here's exactly what I'm looking for:

    I have a fraternity website, and I want in my "Active Members" page to show everyone that is active, but I want the Executive Board at the top, so I will do the E-Board individually up on top, then show the rest of the active members. so I had "SELECT * FROM brothers WHERE active='1' AND position NOT IN ('A', 'B', 'C', 'D', 'E', 'F') ORDER BY initiation_id;" but no one shows up. Any thoughts?
     
  8. retorq

    retorq What up bitch??

    Joined:
    Dec 14, 2006
    Messages:
    6,061
    Likes Received:
    0
    Location:
    Mohave Desert
    Instead of doing the ('a', 'b' ...) you can put the first select statement in that selects the executive board ... would be like

    select * from brothers where active = '1' and position not in
    (select * from brothers where executive = '1') ... been a while since I've had to do this so I'm not sure that code is 100% correct but it gives you an idea ...
     
  9. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    hmmm, didnt think about that. ill try it out. thanks
     
  10. intrktevo

    intrktevo New Member

    Joined:
    Oct 18, 2004
    Messages:
    5,781
    Likes Received:
    0
    Location:
    UCF
    Plug the query into phpmyadmin and see if it returns any errors
     
  11. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    i've never used phpmyadmin. i've always worked straight from shell
     
  12. retorq

    retorq What up bitch??

    Joined:
    Dec 14, 2006
    Messages:
    6,061
    Likes Received:
    0
    Location:
    Mohave Desert
    You can do that straight from a mysql shell too ...
     
  13. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    ... which is what I do
     

Share This Page