Jump to content

Ajax updating database


jrotta

Recommended Posts

Hello, i'm new at the forum, a friend told me that this forum wold help me =)

 

Well, i search, search, search, and search more but cant find a sript like this.

 

I need a code that when you click attack:

 

Print a message in a div:

You lose $losehp HP

update players set hp=hp-$losehp

 

And if $losehp > $playerhp:

You died!

update players set hp=0

 

All this without refresh the page!

 

Please help me, i'm asking in many forums but seems nobody can help me!

 

 

Link to comment
https://forums.phpfreaks.com/topic/169969-ajax-updating-database/
Share on other sites

"Well, i search, search, search, and search more but cant find a sript like this.

 

I need a code that when you click attack:"

 

 

 

Errrr...  We don't code things for people.  (I lied; some people actually do in the freelancing section, but not for free.)

 

Have you tried looking into what AJAX is, how it works and how to use it?  What you're trying to do is pretty straightforward.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.