SRL Archive - Web Development

Does it possible JS PHP MySQL


Laimonas171

2011-03-12 16:00:01

Does it possible to use JS to submit values in database without refreshing the age..

If it's possible with any other programming language just say. for example.

I have

5 [+] < (5 and plus button)

if i click on [+] button then 5 should become 4 and 1 should be added to database, any ideas how to do that? :)

Floor66

2011-03-12 16:09:54

You can use SAJAX: http://www.modernmethod.com/sajax/
Works pretty simple. It's kinda tricky to figure out the callbacks at first but it should be no prob.

Frement

2011-03-14 04:51:05

AJAX call to PHP page which handles the input, also make some failsafes that after 10 queries in 30 seconds it doesn't add anymore, so you don't stress the MySQL.

mormonman

2011-03-14 11:59:29

http://api.jquery.com/category/ajax/

Laimonas171

2011-03-14 16:10:14

From: Frement
AJAX call to PHP page which handles the input, also make some failsafes that after 10 queries in 30 seconds it doesn't add anymore, so you don't stress the MySQL.


an example how to do that? I do not used ajax at all.
It's new thing to me. here is an good tutorial web page for it?

main thing that i need is:

database:
[num1][num2]
[value1][value2]



so i need i have to + buttons one button should add +1 to num1(value1) second one to num2(value2)…

Floor66

2011-03-14 16:58:51

Check my post… It's "Simple AJAX". Should explain a lot.

Frement

2011-03-14 17:38:09

From: Laimonas171
an example how to do that? I do not used ajax at all.
It's new thing to me. here is an good tutorial web page for it?

main thing that i need is:

database:
[num1][num2]
[value1][value2]



so i need i have to + buttons one button should add +1 to num1(value1) second one to num2(value2)…


Well, heres an example :)

http://www.frement.net/projectsf/hpbar/

Something I did to show someone how it was done.

Laimonas171

2011-03-16 12:21:00

I got it work! thanks for help i'll use jQuery works nicely:)