Jump to content
Fórum Script Brasil
  • 0

Jquery e webSql


Letícia Pieper

Question

7 answers to this question

Recommended Posts

  • 0

    db.transaction(function(a) {  
        a.executeSql("SELECT * FROM agendamento WHERE dia = ?;", [hoje], function(a, res3) {
            for (var x = 0; x < res3.rows.length; x++) {
                id_usuario = res3.rows.item(x).id_usuario;
                assunto = res3.rows.item(x).assunto;
                inicio = res3.rows.item(x).inicio;
                fim = res3.rows.item(x).fim;

                db.transaction(function(c) {  
                    c.executeSql("SELECT nome, foto FROM usuario WHERE id_usuario = ?;", [id_usuario], function(c, res1) {
                        nome = res1.rows.item(0).nome;
                        $('#hoje').append( 
                        '<a class="item item-thumbnail-left" href="detalhado.html?id=' + id_usuario + '"><img src="perfil/avatar.png"><h2>' + nome + '</h2><p>' + assunto + '</p><p>início: ' + inicio + ' - Fim: ' + fim + '</p></a>');
                    });
                }); 
            };
        });
    });

Sou iniciante em js e jquery..

Link to comment
Share on other sites

  • 0

Voce pode fazer algo assim:

db.transaction(function(a) {  
        a.executeSql('SELECT * FROM agendamento WHERE dia = "' + hoje + '"', [], function(a, results) {

            //Se codigo

            a.executeSql('SELECT nome, foto FROM usuario WHERE id_usuario = "' + id_usuario + '"', [], function(a, results2) {
                //Se codigo 2
            });

        })
    });

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      651.8k
×
×
  • Create New...