0

i use the below code in order to display a form

    notesdb.transaction(function(t) {
    t.executeSql('SELECT buildingcode, buildingaddress FROM buildings WHERE buildingcode = ?', [BuildingCode], 
            function(t, result) {
                var rowaddress = result.rows.item(0);
                $('#displayflatcomments articleflatcomment').html('Κωδικός: <strong>' + rowaddress.buildingcode + '</strong>');
                $('#displayflatcomments articleflatcomment1').html('Διευθυνση: <strong>' + rowaddress.buildingaddress + '</strong>');
    });

    t.executeSql('SELECT id, BuildingCode, FlatNo, Comment, CommentMore, Closed, New FROM flatcomments WHERE New = 1 ORDER BY BuildingCode ASC', [], 
            function(t, result) {
                var rowcomment = result.rows.item(0);
                //alert(rowcomment.id);
                $('#displayflatcomments articleflatcomment2').html('Ονομα: <strong>' + rowcomment.Comment + '</strong>');
                $('#flatcommentdisplay').val(rowcomment.CommentMore.slice(0, rowcomment.CommentMore.length-16));



        $('#paycommentsdelete').click(function(){
            t.executeSql('DELETE FROM flatcomments WHERE id = ?', [rowcomment.id]); 
            $.mobile.changePage('#comments', 'slideup', false, true);
        });    
        $('#sub').unbind('click').click(function(){

        });
    });

});

I have delete button with paycomentsdelete id.

When I click it i receive Uncaught InvalidError: Failed to execute 'executeSql' on 'SQLTransaction': SQL execution is disallowed.

how can I fix it??

0

1 Answer 1

-1

A thought on this is that SQLite database files have to be writable by the server. (chmod 777). By default you can read from the database but not DELETE or modify.

Inspect your database file for write permissions and make sure writable is enabled. Hope that works.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.