title: MySQL query using sprintf in PHP
body: <p>I have an existing query that uses sprintf to incorporate a php and mysql into a custom MySQL query.</p>
  
  <p>This works great:</p>
  
  <pre><code>$query_EmpVSP = sprintf("SELECT * FROM HTG_VSP WHERE HomeOfEmpNumber IS NULL OR HomeOfEmpNumber = '' OR HomeOfEmpNumber = %s", GetSQLValueString($colname_EmpVSP, "text"));
  </code></pre>
  
  <p>I need to add a second OR statement for another column called CustomForEmpNumber and want to re-use the $colname_EmpVSP value.</p>
  
  <p>When I add</p>
  
  <p><code>. "OR HomeOfEmpNumber = %s", GetSQLValueString($colname_EmpVSP, "text"));</code></p>
  
  <p>I get a invalid syntax at %s  </p>
  
  <p>Here is the current query that shows the error:</p>
  
  <pre><code>$query_EmpVSP = sprintf("SELECT * FROM HTG_VSP WHERE HomeOfEmpNumber IS NULL OR HomeOfEmpNumber = '' OR HomeOfEmpNumber = %s", GetSQLValueString($colname_EmpVSP, "text") . " OR CustomForEmpNumber = %s", GetSQLValueString($colname_EmpVSP, "text"));
  </code></pre>