Select the apropiate MySQL hosting....

General questions about NeoAppBuilder - our rapid application development tool for building HTML5, web and mobile apps.

Moderator: Neosoft Support

Locked
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Select the apropiate MySQL hosting....

Post by David de Argentina »

Hi overthere,

I'm doing a generic App, that retrieves and processes some data from a MySQL database.

As the App will be selled multiple times, and i will provide to the user all access to the hosting / php's / databases, i'm searching for free webhosting services.

Most of them offers MySQL databases, and provide you a SQL_ServerURL, SQL_DatabaseName, SQL_DatabaseUser and SQL_DatabaseUserPass.

Ok, if i run all php's directly into the webbrowser, all works fine.

When i translate the URL to the NAB program using something like:

Code: Select all

document.getElementById('Container1').innerHTML='';
var destino = "http://mywebsite.com/myfolder/index.php";

$.get(destino, function(data,status){
   document.getElementById('Container1').innerHTML='<div style="WIDTH:307px; HEIGHT:390px; overflow-y:scroll">' + data + '</div>';
},'text');
And run as text at Chrome browser, i receive the known message:
XMLHttpRequest cannot load http://mywebsite.com/myfolder/index.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
All my php's begins with:

Code: Select all

<?php
header("Access-Control-Allow-Origin: *");
...
...
?>
I'm trying to understand why php's works fine at webbrowser directly and does not work at NAB program.

I had detected an small difference:

If i execute:

Code: Select all

$link = mysql_connect($dbserver, $dbuser, $dbpass) or die('Could not connect: ' . mysql_error());
mysql_select_db($dbname) or die('Could not select database');
Works fine at webbrowser but does not work at NAB App.

and this:

Code: Select all

$link = mysql_connect('localhost', $dbuser, $dbpass) or die('Could not connect: ' . mysql_error());
mysql_select_db($dbname) or die('Could not select database');
Works fine both webbrowser and NAB App. (with some paid webhostings)

Finally,

Does any know any free web hosting with MySQL databases that allow php's programs call MySQL databases directly at "localhost" AND NOT by another address ?

Thanks in advance,
David de Argentina
Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Re: Select the apropiate MySQL hosting....

Post by Neosoft Support »

There could be, but I kind of doubt that any free or low cost hosting accounts would allow that kind of access to MySQL.
NeoSoft Support
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: Select the apropiate MySQL hosting....

Post by David de Argentina »

Thanks Dave,

I can't force all new users of my app to get a paid (cheap or not) webhosting in order to use my app.

I went for another way, doing all programs as client-server system and compile them with a web2app service.

Finally, all works fine.

I'm not happy because i could not use NAB.

I dont know if you could add some features or tricks in order to bypass this issue.

Greetings from Buenos Aires,
David de Argentina
Locked