question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please help me with callbacks

See original GitHub issue
PlayerTracker.prototype.joinGame = function (name, skin) {

var AccountName = "Guest"
    this.gameServer.SQLconnection.query('SELECT * from tbl_users WHERE userID=' + name, function(err, rows) {
      if (!err) {
    	console.log("User " + rows[0].userName + " Joined the game (" + rows[0].coins + " Coins!)");
      }else{
        console.log('Error while performing Query.');
        accountName = rows[0].userName
      }
    });
    
    console.log(AccountName)<----- undefined




Please could anyone help me?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:23 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Niall7459commented, Jan 28, 2017

IT WORKS IT WORKS I GOT IT WORKING THANKS SO MUCH!!!

I GOT SPEED AND MASS MULTIPLIERS CONNECTING TO THE DATABASE!!!

0reactions
MastaCodercommented, Jan 31, 2017

I hope you’re not sending client information non-encrypted through ws 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Please help me with block-based callbacks - Stack Overflow
I have an ill-understanding of block-based callbacks. There seems to be two approaches that I'm aware of and I don't know when I...
Read more >
JavaScript Callback Functions – What are Callbacks in JS and ...
Callbacks make sure that a function is not going to run before a task is completed but will run right after the task...
Read more >
Please help me understand callback functions : r/learnjavascript
First, you need to understand that functions can be assigned to variables. function myFunction() { console.log('hello world'); } ...
Read more >
Solved Please help me with callbacks! Just let me know which
Please help me with callbacks ! Just let me know which callback goes to what thank u so much. 1) (10 points) Develop...
Read more >
Run pushbutton callback only 3 times, after that display ...
I am new in matlab, can you please help me with this question: While clicking on pushbutton callback it plays wav file.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found