Jump to content

Not defining gender, from DB


Gregg

Recommended Posts

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 MM

And i can get it to work using this but it wont pull all the values.
[code]<?
if($rowuser["genderid"]%2==0)
echo Female;
  else
echo Male;
?>[/code]

Link to comment
Share on other sites

[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 MM

And i can get it to work using this but it wont pull all the values.
[code]<?
if($rowuser["genderid"]%2==0)
echo Female;
   else
echo 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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.