Using a webserver as a medium for database transactions in Torque is a really bad idea since its asynchronous which means you can't just request some data then use it, you have to request it, define a handler for the returned data and then wait for the data to be returned while the program keeps on going.