Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your SQL query is incorrect. It should be in the form --</p> <pre><code>UPDATE &lt;table&gt; SET &lt;field1&gt; = &lt;value1&gt;, &lt;field2&gt; = &lt;value2&gt; ... WHERE &lt;indexfield&gt; = &lt;id&gt; </code></pre> <p>Also, you'll need to escape the values, so it's SET FieldName = 'value'</p> <p>You'd be better off taking advantage of the <a href="http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#update%28java.lang.String,%20android.content.ContentValues,%20java.lang.String,%20java.lang.String%5B%5D%29" rel="nofollow"><code>update</code></a> method.</p> <p>As follows:</p> <pre><code>String updatequery = "UPDATE"+ DBAdapter.DATABASE_TABLE+ " SET "+ DBAdapter.KEY_MESSAGE_1 +"= '"+ b1 + "'," + DBAdapter.KEY_MESSAGE_2 +"= '"+ b2 + "'," + DBAdapter.KEY_MESSAGE_3 +"= '"+ b3 + "'," + DBAdapter.KEY_MESSAGE_4 +"= '"+ b4 + "'," + DBAdapter.KEY_MESSAGE_5 +"= '"+ b5 + "'," + DBAdapter.KEY_MESSAGE_6 +"= '"+ b6 + "'," + DBAdapter.KEY_YOUR_CURRENT_WEBSITE_1 +"= '"+ b7 + "'," + DBAdapter.KEY_YOUR_CURRENT_WEBSITE_2 +"= '"+ b8 + "'," + DBAdapter.KEY_YOUR_CURRENT_WEBSITE_3 +"= '"+ b9 + "'," + DBAdapter.KEY_YOUR_CURRENT_WEBSITE_TYPE +"= '"+ b10 + "'," + DBAdapter.KEY_YOUR_CURRENT_WEBSITE_NEED +"= '"+ b11 + "'," + DBAdapter.KEY_YOUR_CURRENT_WEBSITE_OTHER +"= '" + b12 + "' " + "WHERE" + DBAdapter.KEY_ROWID + "=" + mRowId ; </code></pre> <p>It's still a horrible way to access the database. What you really should do is this --</p> <pre><code>ContentValues values = new ContentValues(); values.put( DBAdapter.KEY_MESSAGE_1, b1 ); values.put( DBAdapter.KEY_MESSAGE_2, b2 ); .... String filter = String.format( "%s = '%s'", DBAdapter.KEY_ROWID, mRowId ); myDB.update( DBAdapter.DATABASE_TABLE, values, filter, null ); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload