phonegap doesn't connect with xampp server on localhost

148
July 27, 2018, at 6:20 PM

I have a PhoneGap project on my windows 7 PC. I have installed the PhoneGap developer app on my PC which connects through server address: http://192.168.1.16:3000.

When I load the project on the PhoneGap developer app, everything works fine. The problem is that I have a database which is saved locally on my PC (localhost) and I access it through XAMPP. When I setup the XAMPP server I can not access the database and when I run the project it's showing me an error.

If I connect an online database on a server it works. I mean it's working with an online database but not working on localhost.

Can anyone help me how to access my database on localhost server.

var url = "http://localhost:81/myapp/auth.php";

And if i run open this link on above image result here:

enter image description here

Answer 1

Your app is running on the Phone and interprets localhost as its own host.

Try to use the IP you get from your Router of your PC smth. like 192.168.x.x or so.

Also be aware that direct connections to your PC-Database may be blocked because of the listen config of your MySQL Server

Rent Charter Buses Company
READ ALSO
Is there any difference in jquery and js methods between bootstrap3 and bootstrap4 [on hold]

Is there any difference in jquery and js methods between bootstrap3 and bootstrap4 [on hold]

Can anybody tell Is there any difference in jquery and js methods between bootstrap3 and bootstrap4

113
Has someone a workaround to activate 2 or multiple dropdowns with Materialize Framework?

Has someone a workaround to activate 2 or multiple dropdowns with Materialize Framework?

I'm trying to have to mutiple dropdowns elements in MaterializeI found out that it doesn't work, but there is a workaround stated here by singhshash:

173
live Comment system with jquery ajax codeigniter php and mysql? Please Help friends [on hold]

live Comment system with jquery ajax codeigniter php and mysql? Please Help friends [on hold]

live Comment system with jquery ajax codeigniter php and mysql, Page should not reload at the form submit

140