I have a dev Windows VM that serves an angularJS app via WAMP. I have been working on the app locally on an iMac that uses MAMP Pro, getting data from the database I've set up on the VM. Unfortunately, when I uploaded everything to the VM for remote testing, the queries start returning empty data and then quit altogether.
In the app is a PHP script that connects to the database using an object supplied via angular's $http method, assembled using a service to provide the query and success/failure functionality. The PHP script then returns a JSON object constructed from the result of the query. This script is used multiple times to get the data for the app. The login scenario is a good example:
In verifyUser = function(username){}, the db is queried for a user, base on a text field entry:
query:"SELECT * FROM xmx_users WHERE user='" + username + "'"
If no user exists with username, addUser = function(username){} is called to add them the db:
query:"INSERT INTO xmx_users (`user`) VALUES ('" + username + "')"
Otherwise the user's content provider list is requested via getUserProviders = function(username){}:
query:"SELECT * FROM xmx_users_providers WHERE user='" + username + "'"
If no provider list exists for the user, get a default list of all providers via getDefaultProviders = function(){}:
query:"SELECT * FROM xmx_providers WHERE active=true;
As stated above, this chain of queries works perfectly on my local machine.
When running on the VM, the first query runs as it does locally up until getDefaultProviders = function(){}, which returns an empty result, and the app just sits there.
What confuses me is how it works for the first three functions but quits the fourth, and that it's only happening on the VM.
Any ideas on what may be causing this? I can post code as necessary, just figured maybe there might be some non-code things to look at first?