raryre23 Posted April 13, 2007 Share Posted April 13, 2007 i downloaded a script for my website which amoungst other things allows users to search for members of the website. however i am intending to use this search as a search for horses instead and so i need to change the script so that instead of looking in the database for M or F (gender of people), it instead looks for S, G or F (the different genders of horses). Im sure it is fairly simple and probably the most basic PHP - i just dont ahve a clue when it comes to PHP! im guessing something here should be changed: $sheading="Search Results"; $lextra="&listpics=$listpics&gender=$gender&age1=$age1&age2=$age2"; if($listpics=="Y") { $sql="select distinct(members.username) from members,photos where members.username=photos.username and approved='Y' and age>=$age1 and age<=$age2 and active=1"; } else { $sql="select distinct(members.username) from members where age>=$age1 and age<=$age2 and active=1"; } if($gender=="M") { $sql=$sql." and gender='M'"; } else if($gender=="F") { $sql=$sql." and gender='F'"; any help would be appreciated... thanks Link to comment https://forums.phpfreaks.com/topic/46860-help-needed-with-searchvery-simple/ Share on other sites More sharing options...
paul2463 Posted April 13, 2007 Share Posted April 13, 2007 change this part <?php if($gender=="M") { $sql=$sql." and gender='M'"; } else if($gender=="F") { $sql=$sql." and gender='F'"; } ?> to <?php if($gender=="S") { $sql=$sql." and gender='S'"; } else if($gender=="G") { $sql=$sql." and gender='G'"; } else if($gender=="F") { $sql=$sql." and gender='F'"; } ?> Link to comment https://forums.phpfreaks.com/topic/46860-help-needed-with-searchvery-simple/#findComment-228491 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.