title: getting single row query by name
body: <p>I have a problem getting single row query by name. Here is my code in <em>main.java</em></p>
  
  <pre><code> String companies=company.getText().toString();
  
   Cursor port=myDb.getRowLasttran(companies);
  </code></pre>
  
  <p>in String companies i have value "Ace Development Bank Ltd"</p>
  
  <p>and in my <em>Dbaadapter.java</em>, i have this </p>
  
  <pre><code>public Cursor getRowLasttran(String company) {
  
      String where = KEY_COMPANIES + "=" + company;
  Cursor c =  db.query( DATABASE_TABLE_LASTTRAN, ALL_KEYS_lasttran, where, null, null, null, null, null);
      if (c != null) {
          c.moveToFirst();
      }
      return c;
  }
  </code></pre>
  
  <p>And in my logcat, i have this error</p>
  
  <pre><code>`03-23 23:00:40.651: E/SQLiteLog(813): (1) near "Development": syntax error
  03-23 23:00:40.671: D/AndroidRuntime(813): Shutting down VM
  03-23 23:00:40.671: W/dalvikvm(813): threadid=1: thread exiting with uncaught exception (group=0xb3a6eba8)
  03-23 23:00:40.971: E/AndroidRuntime(813): FATAL EXCEPTION: main
  03-23 23:00:40.971: E/AndroidRuntime(813): Process: com.example.merostock, PID: 813
  03-23 23:00:40.971: E/AndroidRuntime(813): java.lang.IllegalStateException: Could not execute method of the activity
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.view.View$1.onClick(View.java:3823)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.view.View.performClick(View.java:4438)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.view.View$PerformClick.run(View.java:18422)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.os.Handler.handleCallback(Handler.java:733)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.os.Handler.dispatchMessage(Handler.java:95)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.os.Looper.loop(Looper.java:136)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.app.ActivityThread.main(ActivityThread.java:5017)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at java.lang.reflect.Method.invokeNative(Native Method)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at java.lang.reflect.Method.invoke(Method.java:515)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at dalvik.system.NativeStart.main(Native Method)
  03-23 23:00:40.971: E/AndroidRuntime(813): Caused by: java.lang.reflect.InvocationTargetException
  03-23 23:00:40.971: E/AndroidRuntime(813):  at java.lang.reflect.Method.invokeNative(Native Method)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at java.lang.reflect.Method.invoke(Method.java:515)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.view.View$1.onClick(View.java:3818)
  03-23 23:00:40.971: E/AndroidRuntime(813):  ... 11 more
  03-23 23:00:40.971: E/AndroidRuntime(813): Caused by: android.database.sqlite.SQLiteException: near "Development": syntax error (code 1): , while compiling: SELECT _id, companies, todayclose, yesterdayclose FROM lasttran WHERE companies=Ace Development Bank Ltd
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:58)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:37)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1314)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1161)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1032)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1238)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at com.example.merostock.DBAdapter.getRowLasttran(DBAdapter.java:381)
  03-23 23:00:40.971: E/AndroidRuntime(813):  at com.example.merostock.AddPortfolio.addportfolio(AddPortfolio.java:65)
  03-23 23:00:40.971: E/AndroidRuntime(813):  ... 14 more
  </code></pre>
  
  <p>`</p>