I'm trying to retrieve data through drop-down using Ajax & PHP.
Select option values work fine when paired with database column name but when I change it to be date specific, it doesn't work.
Please go through my code below & suggest the changes required.

HTML:

```
<form>
<select name="users" onchange="showUser(this.value)">
  <option value="">Select a person:</option>
  <option value="1">July</option> // I doesn't work if when I change the value to "\'2015-07-01\' AND \'2015-07-31\'"
  <option value="2">August</option> // I doesn't work if when I change the value to "\'2015-08-01\' AND \'2015-08-31\'"
  <option value="3">September</option> // I doesn't work if when I change the value to "\'2015-09-01\' AND \'2015-09-30\'"
  <option value="4">October</option> // I doesn't work if when I change the value to "\'2015-10-01\' AND \'2015-10-31\'"
  </select>
</form>
<br>
<div id="txtHint"><b>Person info will be listed here...</b></div>

```

Javascript

```
function showUser(str) {
    if (str == "") {
        document.getElementById("txtHint").innerHTML = "";
        return;
    } else { 
        if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        } else {
            // code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
            }
        }
        xmlhttp.open("GET","getleads.php?q="+str,true);
        xmlhttp.send();
    }
}

```

PHP:

```
<?php
$q = intval($_GET['q']);

/*Comments Start, I even tried if else with the select values being only numeric 
if($q==1)
{
$q == "\'2015-07-01\' AND \'2015-07-31\'";
} 
elseif ($q==2)
{
$q == "\'2015-08-01\' AND \'2015-08-31\'";
} 
elseif ($q==3)
{
$q == "\'2015-09-01\' AND \'2015-09-30\'";
}
} elseif ($q==4){
$q == "\'2015-10-01\' AND \'2015-10-31\'";
} else ($q== )
{
$q == "*";
}    
Comments End*/

$con = mysqli_connect('localhost','user','password','database');
if (!$con) {
    die('Could not connect: ' . mysqli_error($con));
}

mysqli_select_db($con,"ajax_demo");
$sql="SELECT * FROM table WHERE ID = '".$q."'";
$result = mysqli_query($con,$sql);

echo "<table>
<tr>
<th>Name</th>
<th>Number</th>
<th>Email</th>

</tr>";
while($row = mysqli_fetch_array($result)) {
    echo "<tr>";
    echo "<td>" . $row['frm_name'] . "</td>";
    echo "<td>" . $row['frm_mobile'] . "</td>";
    echo "<td>" . $row['frm_email'] . "</td>";

    echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>

```

I even tried by removing the back slashes from the dates.
Please help !!