0 Favourites

How do I Use a database?

  • I tried using AJAX, php and mysql but the real problem is that even if i do all ok and i can even get a result via get from my database is not working with construct. I investigated enough to notice that the problem is the following

    "Failed to load resource: the server responded with a status of 404 (Not found) http part / local host : 50000 / <the real entire and rest of data>"

    (and i had to put it not exactly because the edit does not allow me to post urls).

    and its obvioust that is not working because construct is adding the localhost and a : number that should not be there.

    i set that my browser does not "filter" and let me try to grab othe pages, as i can use chrome and disable some stuff, but, even so, its adding the localhost shit. (sorry i am just so tired of trying for about 12 hours).

    please help i really need to debug this program and cannot do it if the only way is to run from the server.

  • Add the php file(s) to your project directory , make Ajax call to those php files

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I cannot do that, because if i do that it will not reach the mysql database. or will really work?

  • you need to include mysql code in php file, it should work based off documentation:

    http://gamedevelopment.tutsplus.com/tut ... edev-11627

  • I know all that and done it, the problem is that the website i use cannot be the same that the website of the game. let me see if i am clear.

    the only thing i could not manage is how to make the ajax reach the website i need that IS NOT the same of the website the game is on.

  • ok new setting, i manage to make a database in my localhost fully so this should not be a different host.

    but even so its still NOT WORKING.

    now i can just make a simple localhost/<directory/file.php with some data and it works.

    so. why when i use Ajax requesting the same does not work?, do i need to use localhost as an adition? is there any limit on what port? should i set php to run in a special port?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)