title: SQL "LIKE" If empty returns all rows
body: <p>Hello I have 2 textboxes and i want to give to the user the option to choose one in order to find results. The user can search through the id or the name. My problem is because i use <code>LIKE%field%</code> when the user chooses to search through the id the name field stays empty and returns all the table rows. I want to have results only if the user enters some value in the textbox. This is my sql query. I'm using mysql</p>
  
  <pre><code>"SELECT * FROM properties WHERE ID='$id' OR Name LIKE '%$name%'"
  </code></pre>
  
  <p>Thank you all</p>