title: syntax for LIKE keyword in PHP using a variable
body: <p>Basically this is the code I am using:</p>
  
  <pre><code>$batch = "XZ";
  $query = $db-&gt;prepare('SELECT day FROM course WHERE course_id LIKE "%'.$batch.'" AND table_name=?');
  $query-&gt;execute([$_SESSION['table_name']]);
  </code></pre>
  
  <p>and I am getting output as NULL;</p>