Jump to content

How to display correct gender?


Gregg

Recommended Posts

Ok, let me first say thanks to "wildteen88" for all the help last time lol.
My data base is set up to hold 6 diffrent genders.
0=None Selected
1=Male
2=Female
3=Couple
4=Group
5=Coulpe FF
6=Couple MM

But when it gets the vars it only displays "Male-Female"?? in the search.
But in the profile it displays it corectly.
Here is the php iuse to pull the info, is there a safe way to echo all but select only one..

[b][color=red]<?[/color][/b]
[color=green]if[/color]($rowuser["[color=red]genderid[/color]"][color=blue]%[/color][color=red]2[/color][color=blue]==[/color][color=red]0[/color])
[color=blue]echo[/color] Female;
[color=green]else[/color]
[color=blue]echo [/color]Male;
[color=red][b]?>[/b][/color]
Link to comment
Share on other sites

it worken but messed upthe results
??
Do i need to change this code to?
<?
include("connect.php");

$sql="select * from users where loggedin='Y'";
$res=mysql_query($sql,$db);
$tot=mysql_num_rows($res);

if(!$argv[1])
{
$pg = 1;
}
else
{
$pg = $argv[1];
}
if(!$pg)
{
$pg = 1;
}
/********************************************************************
Get how many products  are to be displayed according to the  category
********************************************************************/
$total=$tot;
$StartRow =  $PRODUCTSPERPAGE * ($pg-1);

$totalpages = (int) ($total / $PRODUCTSPERPAGE);
if(($total % $PRODUCTSPERPAGE)!=0)
$totalpages++;

$sql .= " LIMIT $StartRow,$PRODUCTSPERPAGE";
$resuser=mysql_query($sql,$db);
$totalrows = mysql_affected_rows();
//echo $sql;
?>
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.