Gregg Posted September 8, 2006 Share Posted September 8, 2006 Ok, the feild i am trying to pull the info from has serveral values.It's on my results page, and it shows all the users matching there discription..(0) (1) Male(2) Female(3) Couple(4) Group(5) Couple FF(6) Couple MMAnd i can get it to work using this but it wont pull all the values.[code]<?if($rowuser["genderid"]%2==0)echo Female; elseecho Male;?>[/code] Quote Link to comment Share on other sites More sharing options...
robos99 Posted September 8, 2006 Share Posted September 8, 2006 What exactly is the problem you're having? Your list of values...are those just the possible values for your gender column in the DB? Or is that entire list in the gender column? Quote Link to comment Share on other sites More sharing options...
mewhocorrupts Posted September 8, 2006 Share Posted September 8, 2006 [quote author=Gregg link=topic=107375.msg430767#msg430767 date=1157737546]Ok, the feild i am trying to pull the info from has serveral values.It's on my results page, and it shows all the users matching there discription..(0) (1) Male(2) Female(3) Couple(4) Group(5) Couple FF(6) Couple MMAnd i can get it to work using this but it wont pull all the values.[code]<?if($rowuser["genderid"]%2==0)echo Female; elseecho Male;?>[/code][/quote]I'm a little confused by the code you included in your post. Why would you use the modulus operator to determine if they are male or female? What if the "genderid" is "5" -- Couple FF -- the code you have would print Male. Quote Link to comment Share on other sites More sharing options...
Barand Posted September 8, 2006 Share Posted September 8, 2006 Use an array[code]<?php$gender = array ( 1 => 'Male', 2 => 'Female', 3 => 'Couple', 4 => 'Group', 5 => 'Couple FF', 6 => 'Couple MM');echo $gender[$rowuser["genderid"]];?>[/code] Quote Link to comment Share on other sites More sharing options...
Gregg Posted September 8, 2006 Author Share Posted September 8, 2006 Thanks "Barand" worked great!And sorry i posted this kind of confusing i was on the way out so needed to save it befor i left lol..I needed the right code to get all of the genders and the one posted worked when i inter graded it into the head code so thanks. :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.