can someone help me to do a pagination? I am using node.js and mysql, and I have not found a material to help me, when I search I only find material for MongoDB. I am trying to make a page for a CRUD, but I can't find the way to do it. I have a little idea on the server side, but I have absolutely no idea how to implement it in the buttons on the client side. Thanks a lot! This is a fragment of my code where i consult all users to display them, this fragment is in a controller.
controller.list = function(req, res, next) {
req.getConnection((err, conn) => {
conn.query('SELECT * FROM usuarios', (err, usuario) => {
if(err) {
res.json(err);
}
if(req.session.loggedin) {
res.render('usuarios', {
data: usuario,
login: true,
nombre: req.session.nombre
});
}else{
return res.redirect('/admin');
}
});
});
};