Results 1 to 3 of 3

Thread: Mysql code help.

  1. #1
    Join Date
    Jul 2011
    Posts
    36
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Mysql code help.

    Hi

    I have a code that looks like this atm for mysql db display.

    $modsql = bb_db_query("select * from regd_members order by username limit 24");

    Basically it list all the regd_members in the db. I want to mod it a bit so that it selects * from regd_members and it will only list username if the "password" field is equal to "superman". What do i need to add in my current line of code for it to do that??

    Thanks in advance

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Something like..
    PHP Code:
    $modsql bb_db_query("select `username` from regd_members where  `password` = 'superman' order by username limit 24"); 
    Assuming you havent hashed or encrypted that password which you should be doing.
    Corrections to my coding/thoughts welcome.

  3. #3
    Join Date
    Jul 2011
    Posts
    36
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Perfect thanks alot.

Bookmarks

Posting Permissions

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