function get_all_channels_by_order(){
    var foobar = false
    mysql_connection.connect()
    mysql_connection.query("SELECT * FROM channels ORDER BY listorder ASC", function(){
        foobar = true
    })
    mysql_connection.end()
    console.log(foobar)
}
I need foobar to return true but instead it returns false.
This is due of course to the JavaScript scopes, but I was wondering is there any way to overcome this? Or is it impossible?
I am sorry to ask such a common question, but I have looked at several other Stack Overflow questions and they have not helped, I also tried lots of other code rather than this but no successes.
 
    