0

I'm trying to get data from a database, store that data in a javascript variable, and use that variable within my local code. Due to mysql being asynchronous, it seems that I cannot run anything after querying, and the data saved in the variable is only saved in the variable within the query function.

This also prevents me from making another query, as that query doesn't run unless it is within the first query's function.

Is there a way to run the query, store the data, close that query and continue with the rest of my code(e.g. run another query)?

YawZing6
  • 13
  • 5
  • Does this help you? https://stackoverflow.com/questions/14220321/how-do-i-return-the-response-from-an-asynchronous-call – Jeremy Thille Mar 15 '21 at 13:07
  • Looking through it, and I'm getting a better understanding of the 'Asynchronous' aspects. I'll confirm with you in a bit – YawZing6 Mar 15 '21 at 13:24

0 Answers0