Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.getUsers = function (res) {
- connection.acquire(function (err, con) {
- con.query('SELECT * FROM user', function (err, result) {
- con.release();
- if(err) {
- console.log(err);
- } else {
- obj = {print: result};
- console.log(obj);
- }
- });
- });
- };
- app.get('/settings', function(req, res) {
- databaseFunctions.getUsers(res);
- res.render('settings', {
- title: 'Settings',
- classname: 'settings'
- });
- });
- <% print.forEach(function(users) { %>
- <tr>
- <td><%= users.mail %></td>
- <td><%= users.name %></td>
- <td><%= users.password %></td>
- <td><%= users.groups %></td>
- <td><%= users.accountLevel %></td>
- </tr>
- <% }); %>
- { print:
- [ RowDataPacket {
- mail: 'info@andreasekman.com',
- name: 'test',
- password: '1234',
- groups: 'java2',
- accountLevel: 'User' },
- RowDataPacket {
- mail: 'xtironman@hotmail.com',
- name: 'ace',
- password: 'ace',
- groups: 'java2',
- accountLevel: 'User' } ] }
- TypeError: C:UsersAndreasDocumentsGitHubQuizviewssettings.ejs:15
- 13| <h1>Settings</h1>
- 14| <% include partials/template/createuser.ejs %>
- >> 15| <% include partials/template/viewusers.ejs %>
- 16| </div><!-- row -->
- 17| <div class="content"></div>
- 18| <% include partials/template/footer.ejs %>
- esc is not a function
- at rethrow (C:UsersAndreasDocumentsGitHubQuiznode_modulesejslibejs.js:285:18)
- at eval (eval at compile (C:UsersAndreasDocumentsGitHubQuiznode_modulesejslibejs.js:524:12), <anonymous>:85:9)
- at eval (eval at compile (C:UsersAndreasDocumentsGitHubQuiznode_modulesejslibejs.js:524:12), <anonymous>:87:10)
- at returnedFn (C:UsersAndreasDocumentsGitHubQuiznode_modulesejslibejs.js:555:17)
- at tryHandleCache (C:UsersAndreasDocumentsGitHubQuiznode_modulesejslibejs.js:203:34)
- at View.exports.renderFile [as engine] (C:UsersAndreasDocumentsGitHubQuiznode_modulesejslibejs.js:412:10)
- at View.render (C:UsersAndreasDocumentsGitHubQuiznode_modulesexpresslibview.js:126:8)
- at tryRender (C:UsersAndreasDocumentsGitHubQuiznode_modulesexpresslibapplication.js:639:10)
- at EventEmitter.render (C:UsersAndreasDocumentsGitHubQuiznode_modulesexpresslibapplication.js:591:3)
- at ServerResponse.render (C:UsersAndreasDocumentsGitHubQuiznode_modulesexpresslibresponse.js:960:7)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement