title: Ajax fetch variable to php to select from SQL
body: <p>So I need to pass variable to my "fetch" php, on <code>fetch.php</code> I make query to mysql DB with given parameters. </p>
  
  <p>And now I am stuck..</p>
  
  <p>I am able to fetch variable like so : </p>
  
  <pre><code>data: {
      "Kood":'&lt;?php echo $params-&gt;get('Kood');?&gt;'
  },
  </code></pre>
  
  <p>Then I catch it in <code>fetch.php</code> and make request to db : </p>
  
  <p>(after some if statements I make sql request)</p>
  
  <pre><code>$query .= 'and kood LIKE "%'.$_POST["Kood"]["value"].'%"  ';
  </code></pre>
  
  <p>Everything works almost fine but instead of "Like" I would use Equal, if I change my request to equal then it fails to get any results back.. </p>
  
  <p>Example : </p>
  
  <pre><code>select * 
  from table 
  where kood='KERR2018' 
  </code></pre>
  
  <p>(btw when I use like then it also gets KERR2019 results somehow..)</p>
  
  <p>and thats how I tried to get "equal" to :</p>
  
  <pre><code>$query .= 'and kood ="'.$_POST["Kood"]["value"].'"  ';
  </code></pre>
  
  <p>I feel like, it looses numbers and uses only chars?</p>
  
  <p>When I made var in <code>fetch.php</code> (<code>$Kood="KERR2018";</code>) then it worked as I wanted..</p>