1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

SELECT * NOT password FROM table??? how to do that

Discussion in 'PHP' started by bobby9101, Dec 27, 2006.

  1. #1
    hi, i want to select all info from a table - one row.
    Like SELECT * (other than the password) FROM table
    is that possible? other than doing it by selecting each row speperatly
     
    bobby9101, Dec 27, 2006 IP
    ServerUnion likes this.
  2. av1

    av1 Active Member

    Messages:
    168
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #2
    how about keeping the password in a separate table?
     
    av1, Dec 27, 2006 IP
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    You wither have to select each column individually, or you can just not use that column any further in your script. I don't think there is any way to exclude a column from a select statement.
     
    jestep, Dec 27, 2006 IP
    ServerUnion likes this.
  4. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Depending on your database engine, you could use a view to select certain columns. Either way, best choice is to ALWAYS type out all the column name for best performance. Good luck.
     
    ServerUnion, Dec 27, 2006 IP
  5. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks guys :eek:
     
    bobby9101, Dec 27, 2006 IP
  6. bochgoch

    bochgoch Peon

    Messages:
    1,918
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #6
    bochgoch, Dec 27, 2006 IP
  7. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #7
    @bochgoch: hashed passwords I agree with, but you could explain a bit more about why they should be in their own table? Just curious as I can't see why it would be more secure (plus it goes against database normalisation I feel).
     
    TwistMyArm, Dec 27, 2006 IP
  8. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You can then set distinct user rights to the password table then.
     
    ServerUnion, Dec 27, 2006 IP
  9. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Oh I see... so you use one database user for verifying passwords and another for everything else then? I can see that, though I don't think I'm going to be doing it any time soon ;)
     
    TwistMyArm, Dec 27, 2006 IP