1

how should we get the value from the sqlite using java script as we give in android.

instance name = db.arraylistname(id);
column name =  instance name.get(0).get("column name");

how should we give it in java script?

how can we set text as we do in android such as,

text_view.setText(column name);

how should we give it in java script?whereas i have given the text as a listview's data.

Rather,all the data in the "column name" should be viewed as a list view.

and normally,how should we settext for a tag as we do it for a text view in android.

i mean i would like to get a value from the database and place it in the content of the para tag <p>....</p>

please..help..i have no clue of it.

when i use the following coding to retrieve the data

var len = results.rows.length;
for (var i = 0; i < len; ++i) 
{
    var obj = results.rows.item(i);
    console.log(+obj);               
}

i get the following in the log

04-17 11:54:59.416: D/CordovaLog(23307): Returned rows = 2
04-17 11:54:59.416: I/Web Console(23307): Returned rows = 2 at file:///android_asset/www/index.html:33
04-17 11:54:59.416: D/CordovaLog(23307): NaN
04-17 11:54:59.416: I/Web Console(23307): NaN at file:///android_asset/www/index.html:38
04-17 11:54:59.427: D/CordovaLog(23307): NaN
04-17 11:54:59.427: I/Web Console(23307): NaN at file:///android_asset/www/index.html:38
04-17 11:54:59.427: D/CordovaLog(23307): No rows affected!
04-17 11:54:59.427: I/Web Console(23307): No rows affected! at file:///android_asset/www/index.html:44

i get NaN iwhereas i should get the data entered into the table.

1 Answer 1

1

Well,i found the answer for first half of this question,

if we want the id from the table we need to code for phonegap

function querySuccess(tx, results) 
{
    var len = results.rows.length;
    console.log("DEMO table: " + len + " rows found.");
    for (var i=0; i<len; i++)
    {
         console.log("Row = " + i + " id = " + results.rows.item(i).id);
     }
}

The exact code for retrieving the value is..

" id = " + results.rows.item(i).id 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.