Is there a way to insert and pull images from a sql db? I can do it with text but can’t figure out how to do it with images.
here is what I’m doing for inserting and grabbing txt is there a way to change this up so I can use it for images?
var index_count = 0
var up_check = 0
var r = "rr"
function get_db(a, up_check) {
var db = LocalStorage.openDatabaseSync("DB5", "1.0", "The Example QML SQL!",
1000000);
db.transaction(
function(tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT,
salutee TEXT)');
for ( var z=0; z<1000; z++){
tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'Movie', z ]);
}
var rs = tx.executeSql('SELECT * FROM Greeting');
r=""
if (index_count <0)
index_count=0;
// for(var i = 0; i < sa; i++) {
if (up_check === 0)
r += rs.rows.item(index_count).salutation + ": " +
rs.rows.item(index_count).salutee + "\t\t"
if (up_check === 1){
r += rs.rows.item(index_count).salutation + ": " +
rs.rows.item(index_count).salutee + "\t\t"
}
}
//}
)
console.log(r);
index_count=a;
return r;
}
↧