like operator syntax in sqlite with android
<p>I'm developing with Android and I need to do a query with sqlite using the like operator and variables. </p>

<p>The piece of code I just try to modify is, the implementation of a database present at <a href="http://saigeethamn.blogspot.it/2009/10/android-developer-tutorial-part-12.html" rel="nofollow">this link.</a></p>

<p>So, I'm trying to do a query on the table created in the link in order to select just a name from a table. I'm doing like this:</p>

<pre><code>Cursor c = sampleDB.rawQuery("SELECT FirstName, Age FROM " +
SAMPLE_TABLE_NAME + " where" +field+ " like %"+search+"%" , null);
</code></pre>

<p>where field and search are two variable defined above in this way:</p>

<pre><code>final String field = "LastName";
final String search = "Makam";
</code></pre>

<p>If I execute the app in output, I should see a row with the name and age that I have selected in the query.But, I obtain nothing!!!</p>

<p>The <code>Logcat of Eclipse</code> shows :</p>

<pre><code>sqlite returned: error code = 1,msg = near "like": syntax error.
</code></pre>

<p>But I'm pretty sure the syntax it' s correct. Could someone help me?</p>
