update data from database

Get help using Construct 2

Post » Thu Dec 13, 2012 5:42 am

Hi Guys,

I create function to update user data fetch from database but its not working.

here's what i did.
1. when i click profile_update it will display the name.text and score.text and should be display the the name and score of user on the textbox.

2. I call ajax when object click AJAX => request url => to get the data from database base on user info.

problem is When I click the update it will return the name and score on the textbox. for name.text the value is "name and score" also on score.text.

How to separate the two value to put on name.text for name and score.text for score
B
11
S
3
G
2
Posts: 40
Reputation: 2,362

Post » Thu Dec 13, 2012 7:41 am

please a example .capx
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Thu Dec 13, 2012 9:15 am

this is my sample http://www.mediafire.com/?2xp1pllip9wrdgn
and this is my php http://www.mediafire.com/?vvuaztwmd8vcxc3

I hope you can help me on this problem.george2012-12-13 09:18:58
B
11
S
3
G
2
Posts: 40
Reputation: 2,362

Post » Thu Dec 13, 2012 10:01 am

The for each must be in the on complete.

And you set to PetNametxt the same value how you set on PetScoretxt.

A tip from me search the forums for the json Hash plugin -> install it --> send from your php a json object like [{PetNametxt: Bobi; PetScore.txt: 4000;}] -> In the oncomplete load the Hash table and than just set the variable values like: PetNametxt = HashAt("0.PetNametxt")
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Fri Dec 14, 2012 3:51 am

hmmmmm... Can you do some sample on my capx?
B
11
S
3
G
2
Posts: 40
Reputation: 2,362


Return to How do I....?

Who is online

Users browsing this forum: amarcelo, Draconinho, LeFuji, plinkie, totoe and 18 guests