PDA

View Full Version : Does it possible JS PHP MySQL



Laimonas171
03-12-2011, 09:00 PM
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
03-12-2011, 09:09 PM
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
03-14-2011, 08:51 AM
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.

tls
03-14-2011, 03:59 PM
http://api.jquery.com/category/ajax/

Laimonas171
03-14-2011, 08:10 PM
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
03-14-2011, 08:58 PM
Check my post... It's "Simple AJAX". Should explain a lot.

Frement
03-14-2011, 09:38 PM
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
03-16-2011, 04:21 PM
I got it work! thanks for help i'll use jQuery works nicely:)