I am testing on a local machine and am having problems with only ONE query that I try to make and am wondering if there is a fundamental issue, maybe persmissions, I am simply not understanding. This EXACT same code, files,etc. work perfectly on my remote server.

I make my DB query with an include file. The first php script I run queries the DB no problem, but the second simply doesn't. I know that the username, password, localhost etc. is configured correctly, becasue I can log into the DB directly with no problem and because the first query works with no problem. Is there ANYTHING that I am missing? I take the exact same files and dump it onto another server (with a different host name) and there are no problems?! Please help, this issue has been killing me for some time now and I can't even get a testing environment set up to work on.

I am almost possitive it is not the php code but something to do with permissions which I simply don't understand. If there is anyone that could at least explain to me how permissions work on unix (macOSX) and with mySQL, like, when I make a query is it me (root user) or mysql? If anyone could just help me understand the basics I would REALLY apreciate it so I can try to solve this problem. Thanks.