title: query execution with prepared statements not working
body: <p>i am using ajax to display dynamic data on my website! previously it was done using simple mysqli queries now i am improving my website's security by adding prepared statements,i have two queries one is written in mysqli and other in prepared statements here's the mysqli query</p>
  
  <pre><code>$sql = "SELECT DISTINCT model_trim FROM `tbl_02_models` WHERE model_year='$year' and model_name='$model' and model_make_id='$make' ";
      $run = mysqli_query($db, $sql);
      while ($row = mysqli_fetch_array($run)) {
          if($row['model_trim']){
          $data2[$i]['model_trim']=$row['model_trim'];
          $i++;
          }
      }
  </code></pre>
  
  <p>and here's the prepared statement query</p>
  
  <pre><code>$query="SELECT DISTINCT model_trim FROM `tbl_02_models` WHERE model_year=? and model_name=? and model_make_id=?";
                  $stmt = $db-&gt;prepare($query);
                  if($stmt){
  
                      $stmt-&gt;execute();
                      $stmt-&gt;bind_param("iss",$year,$model,$make);
                      $stmt-&gt;bind_result($model_trim);
                      while ($stmt-&gt;fetch()) 
                      {
                          if($model_trim)
                          {
                          $data2[$i]['model_trim']=$model_trim;
                          $i++;
                          }
  
                      }
                          $stmt-&gt;close();                 
                      }
  </code></pre>
  
  <p>the query written in simple mysqli is working fine but when i am using the same query in prepared statements it is returning me null! any idea?</p>