Skip to content

Instantly share code, notes, and snippets.

@ZeroByter
Created April 15, 2016 20:37
Show Gist options
  • Select an option

  • Save ZeroByter/be33b2c4bc5bcab78b1c1aa6a9d1f0b6 to your computer and use it in GitHub Desktop.

Select an option

Save ZeroByter/be33b2c4bc5bcab78b1c1aa6a9d1f0b6 to your computer and use it in GitHub Desktop.
function get_all_channels_by_order(){
var channels = []
function process(err, result){
channels = result
}
mysql_connection.connect()
var result2 = mysql_connection.query("SELECT * FROM channels ORDER BY listorder ASC", function(err, result){process(err, result)})
mysql_connection.end()
console.log(channels) //this still returns an empty array :(
return channels
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment