Advertisement
Guest User

Untitled

a guest
Mar 1st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. this.getUsers = function (res) {
  2. connection.acquire(function (err, con) {
  3. con.query('SELECT * FROM user', function (err, result) {
  4. con.release();
  5. if(err) {
  6. console.log(err);
  7. } else {
  8. obj = {print: result};
  9. console.log(obj);
  10. }
  11. });
  12. });
  13. };
  14.  
  15. app.get('/settings', function(req, res) {
  16. databaseFunctions.getUsers(res);
  17. res.render('settings', {
  18. title: 'Settings',
  19. classname: 'settings'
  20. });
  21. });
  22.  
  23. <% print.forEach(function(users) { %>
  24. <tr>
  25. <td><%= users.mail %></td>
  26. <td><%= users.name %></td>
  27. <td><%= users.password %></td>
  28. <td><%= users.groups %></td>
  29. <td><%= users.accountLevel %></td>
  30. </tr>
  31. <% }); %>
  32.  
  33. { print:
  34. [ RowDataPacket {
  35. mail: 'info@andreasekman.com',
  36. name: 'test',
  37. password: '1234',
  38. groups: 'java2',
  39. accountLevel: 'User' },
  40. RowDataPacket {
  41. mail: 'xtironman@hotmail.com',
  42. name: 'ace',
  43. password: 'ace',
  44. groups: 'java2',
  45. accountLevel: 'User' } ] }
  46.  
  47. TypeError: C:UsersAndreasDocumentsGitHubQuizviewssettings.ejs:15
  48. 13| <h1>Settings</h1>
  49. 14| <% include partials/template/createuser.ejs %>
  50. >> 15| <% include partials/template/viewusers.ejs %>
  51. 16| </div><!-- row -->
  52. 17| <div class="content"></div>
  53. 18| <% include partials/template/footer.ejs %>
  54.  
  55. esc is not a function
  56. at rethrow (C:UsersAndreasDocumentsGitHubQuiznode_modulesejslibejs.js:285:18)
  57. at eval (eval at compile (C:UsersAndreasDocumentsGitHubQuiznode_modulesejslibejs.js:524:12), <anonymous>:85:9)
  58. at eval (eval at compile (C:UsersAndreasDocumentsGitHubQuiznode_modulesejslibejs.js:524:12), <anonymous>:87:10)
  59. at returnedFn (C:UsersAndreasDocumentsGitHubQuiznode_modulesejslibejs.js:555:17)
  60. at tryHandleCache (C:UsersAndreasDocumentsGitHubQuiznode_modulesejslibejs.js:203:34)
  61. at View.exports.renderFile [as engine] (C:UsersAndreasDocumentsGitHubQuiznode_modulesejslibejs.js:412:10)
  62. at View.render (C:UsersAndreasDocumentsGitHubQuiznode_modulesexpresslibview.js:126:8)
  63. at tryRender (C:UsersAndreasDocumentsGitHubQuiznode_modulesexpresslibapplication.js:639:10)
  64. at EventEmitter.render (C:UsersAndreasDocumentsGitHubQuiznode_modulesexpresslibapplication.js:591:3)
  65. at ServerResponse.render (C:UsersAndreasDocumentsGitHubQuiznode_modulesexpresslibresponse.js:960:7)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement