How do I Use a database?

Get help using Construct 2

Post » Tue Sep 23, 2014 6:36 pm

Message: stelarfox is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
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.
B
5
S
1
Posts: 23
Reputation: 421

Post » Tue Sep 23, 2014 10:11 pm

Add the php file(s) to your project directory , make Ajax call to those php files
B
6
S
2
Posts: 151
Reputation: 1,366

Post » Wed Sep 24, 2014 1:24 pm

I cannot do that, because if i do that it will not reach the mysql database. or will really work?
B
5
S
1
Posts: 23
Reputation: 421

Post » Wed Sep 24, 2014 4:54 pm

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

http://gamedevelopment.tutsplus.com/tut ... edev-11627
B
6
S
2
Posts: 151
Reputation: 1,366

Post » Wed Sep 24, 2014 5:05 pm

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.
B
5
S
1
Posts: 23
Reputation: 421

Post » Wed Sep 24, 2014 6:39 pm

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?
B
5
S
1
Posts: 23
Reputation: 421


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 9 guests