Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. async function getInfo(name) {
  2. let info = await selectInfo(name);
  3. console.log('info for ',name + ': ' + info.uuid);
  4. return;
  5.  
  6. }
  7.  
  8. function selectinfo(name) {
  9. let selectSQL = "select uuid, name from info where name = ?";
  10. db.query(selectSQL, name, function(err, rows) {
  11. if (!rows) {
  12. console.log('no info found for name: ',name);
  13. return;
  14. }
  15. let info = {
  16. 'uuid':rows[0].uuid,
  17. 'name':rows[0].name
  18. }
  19. console.log(info);
  20. return info;
  21. })
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement