Log in

View Full Version : Mysql code help.



mikster
10-09-2011, 03:59 AM
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

bluewalrus
10-09-2011, 06:51 AM
Something like..

$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.

mikster
10-09-2011, 06:44 PM
Perfect thanks alot.