Nothing to do with SQLite, but ... On Fri, Mar 18, 2011 at 4:01 AM, Matt Young <youngsan...@gmail.com> wrote: > > Here is my Javascript code, it works. Except I have to know the table field > names within the javascript code itself: This little phrase: > > results.rows[i].f1 > > f1 is a field name, I have to know this in the call. > Yes I know indexDB is coming, but is there a workaround for this? I want to > scoop up the roiw even though I do not know the column names. > > function executeSqlRead(sqlString) { > db.transaction( > function (tx) { > tx.executeSql(sqlString, [], > function (tx, results) { > var numrows = results.rows.length; > > qout.innerHTML += tx + "<p>Rd: " + numrows +" rows</p>"; > var i = 0;
> while( i < numrows) { > qout.innerHTML += > "<p>" + results.rows[i].f1 + "</p>" ; > i += 1; > } How about: while( i < numrows) { qout.innerHTML += "<p>"; for( var p in results.rows[i]) { qout.innerHTML += results.rows[i][p]; } qout.innerHTML += "</p>"; i += 1; } Or variations that factor out the collection of property names (outside of the loop), since they will be the same for every row. > }, function (t, e) { > qout.innerHTML += '<p> Error: '+e.message+'</p>'; > } > ); > } > ); > } > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users