title: How to write jquery code within php code
body: <p>Hello, I would like to add some JQuery code when my MySQL query match a specific ID, here is my code: </p>
  
  <pre><code>&lt;?php
  $chkgreenmark ="select * from TABLE where PARAM = '$VARIABLE'";
  $sqlchkgreenmark = mysqli_query($GLOBALS['mysqli'],$chkgreenmark);
  $numsqlchkgreenmark = mysqli_num_rows($sqlchkgreenmark);
  if($numsqlchkgreenmark &gt; 0) { ?&gt;
  
  &lt;script type="text/javascript"&gt;
      $(".calendercolumn .dragbox #dragID").append("&lt;div class='detailssaved'&gt;&lt;a href='#' &gt;&lt;img src='./images/check_mark.JPG' height='15' width='15'&gt;&lt;/a&gt;&lt;/div&gt;");
  &lt;/script&gt;
  &lt;?php 
  }?&gt;
  </code></pre>
  
  <p>The problem is that I get the JQuery code even when I don't have any result.</p>
  
  <p>Can anyone please help me? </p>