Forum Moderators: coopster

Message Too Old, No Replies

php/ajax easiest way to update a mysql database without reloading

         

skoff

5:31 am on Feb 15, 2012 (gmt 0)

10+ Year Member



Hi everyone! So i'll try to be as clear as possible!

So what i want to do is this :

Every time someone click on a team name it adds a record inside a mysql table.
I'm looping through my table records to sort all teams
Example :
-Team 1
-Team 2
-Team 3

If i click on team 1 i want to be able to see the record beside it so it would become :
Example :
-Team1 (1)
-Team2
-Team3

The thing is that i know how to add the record to my database and all of this. The point where i'm stuck right now is that i want this to be transparent so if i click on a team name i dont want the page to be refreshed. I know i can do something like that with ajax or jquery but that's the information that i'm missing.

Hope someone will be able to help me with that!

Thanks!

Habtom

5:35 am on Feb 15, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Read more about XMLHttpRequest, and search for PHP AJAX sample code or something similar. That should get you started.