title: How to query using LIKE clause in mysql using vb.net comparing to a varied string input?
body: <p>I've search and tried a lot of procedure but did not work.
  CREATE PROCEDURE did not work, SET @variable is not acceptable and a couple more codes. This is my last "query" code that still didn't work.</p>
  
  <pre><code>qry = "select * from employeefile where empfname LIKE '%''" + input + "''%'"
  </code></pre>
  
  <p>empfname is a name of an employee from table employeefile that possibly consists of three words. The input could be the first word, second word, third word or the entire words.</p>
  
  <p>when i tried to input any word within the name, the program will still prompt, "no records found." when i tried to change the query into</p>
  
  <pre><code>qry = "select * from employeefile where empfname LIKE '%existingname%'"
  </code></pre>
  
  <p>and my input is "existingname", the program runs just as i want it to.</p>
  
  <p>This code is one of those that i seached but still didn't work.</p>
  
  <p><a href="https://stackoverflow.com/questions/14237755/t-sql-and-the-where-like-parameter-clause">T-SQL and the WHERE LIKE %Parameter% clause</a></p>
  
  <p><a href="https://stackoverflow.com/questions/15926724/how-to-use-like-clause-in-mysql-5-0-statement">How to use like clause in MySQL 5.0 Statement</a></p>
  
  <p><a href="https://stackoverflow.com/questions/14237755/t-sql-and-the-where-like-parameter-clause">T-SQL and the WHERE LIKE %Parameter% clause</a></p>
  
  <p>The problem here is when i use a variable... i probably get the wrong way of using it into query. Please help me. I am new here by the way.</p>