javascript - Cannot read property 'updates_title' of undefined data which is clearly defined -


i'm receiving error of undefined data.

throw err; // rethrow non-mysql errors

typeerror: cannot read property 'updates_title' of undefined

my node.js code causing issue:

app.get("/aktualnosci/:update_id", function(req, res){    console.log(req.params.update_id);    con.query("select * tbl_updates updates_id = ('"+req.params.update_id+"')" , function(err, result, fields){      console.log(result[0]);      res.render('aktualnosci', {title: result[0].updates_title, text: result[0].updates_title});    });    }); 

jade code:

.container    hr    .row       .col-lg-6          h1 #{title}    .row       .col-lg-12          p #{text} 

also got console log of data i'm receiving database

rowdatapacket { updates_id: 4, updates_title: 'czwarty post, !!!', updates_text:'loremloremloremloremloremloremloremloremloremloremloremloremloremloremloremloremloremlorloremloremloremloremlorem' } 

the problem why error occurring when it's shown data not undefined.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -