Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get('/noticias',function(req , res){
- var mysql = require('mysql');
- var connection = mysql.createConnection({
- host :'localhost',
- user:'root',
- pass:'',
- database:'portal_noticias'
- });
- connection.query('select * from noticias', function(error , result){
- // retorna o resultado para view
- res.render('noticias/noticias',{noticia : result});
- });
- </tr>
- <% for(var i=0;i<noticia.lenght;i++){ %>
- <%= noticia[i].id_noticias %> - <%= noticia[i].id_noticias %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement