Jquery mobile + php + external server/database issue

Jquery mobile + php + external server/database issue

Hello all,
I started to learn jquery mobile and now I'm making a cross platofrm apllication. 50% of the app is done but now I'm struggling at something very important. My app communicates with an external server (database) but I just can't make it work. I made some html + php tests and if I put the html,js & php files in the server and run the pages from there, everything works. But if I build the app to my device, I'll get the html + js into my device and the php file will stay on the server folder. That way, I can't do anything between the device and the server. Is there anything that I missed how I was supposed to build/do things? I'm using ajax and json aswell

Thank you in advance.