Forum Moderators: coopster

Message Too Old, No Replies

Invision Power Board

         

msmtrimm

1:52 am on Aug 11, 2004 (gmt 0)

10+ Year Member



I am looking for adding some php and mysql features to my forum, as such. I will try to explain this the easiest as I can.

On the forum home page, I would like to have an if else statement on it. I started coding like this....
$sql = "SELECT * FROM ibf_members";
if($sql === g){
echo "Welcome to Gryffindor.";
}

It is a Harry Potter/ Car fan site, Kinda bad mix, but I have added a custom profile field called "Hogwarts House" and I would like to give members access to their house common room without needing to show all of the forums in the forum list....

So here is what a member does to get a hogwarts house...

1)Register
2)Choose House
3)On home page, their house should show up with a like to their common room.

Thanks for your time and I hope you can help me out. Thanks.

[edited by: coopster at 2:05 pm (utc) on Aug. 11, 2004]
[edit reason] Removed personals [/edit]

coopster

2:16 pm on Aug 11, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, msmtrimm!

It sounds like you are on the right track. If you want only the information to be retrieved from the database table for a particular member,you need to add a WHERE clause to your sql statement. Something along the lines of

$sql = "SELECT * FROM ibf_members WHERE user = '$username'";

msmtrimm

1:01 am on Aug 12, 2004 (gmt 0)

10+ Year Member



Okay, thanks a lot!