Sorry if the wording in the title is not correct (new to PHP). I'm trying to return results from a mysql db using below php scripts.
php script
<?php
require "conn.php";
$adopt_id = $_GET["adopt_id"];
  $query = "
select *
from temp_table
where adopt_id = $adopt_id
";
....
?>
Now if I run the above in my browser as url below, it returns as expected http://localhost/searchfeed.php?adopt_id=1
Dump of above query:
select *
from temp_table
where adopt_id = 1
Same php script but filtering on a diff field which is of varchar data type.
php script
    <?php
    require "conn.php";
    $GENDER = $_GET["gender"];
      $query = "
    select *
    from temp_table
    where gender = $GENDER
    ";
    ....
    ?>
Now if I run the above in my browser as url below, it returns null because its not getting any results = http://localhost/searchfeed.php?gender=M
I dumped the above query to a log file, seems like it doesn't do anything with the $GENDER. This is what the query looks like
select *
from temp_table
where gender = 
 
     
     
     
    