Jump to content

take from mysql


grlayouts

Recommended Posts

hey Guys I have a table in a db that stores attack details for my game below

 

id 	attacker 	win 	defender 	time 	deleted
1 	17 	          1 	84 	1288576720 	0
2 	22 	          1     84 	1288576989 	0

 

i want to give a stat like,

 

total attacks made : 20 (times there id is attacker)

percent successful = 20% (if win =1 its a win =0 its a loss)

 

and the same with times attacked.

 

I was thinking along the lines of getting the info using

$stat = mysql_fetch_array(mysql_query("select * from attacklog where attacker='$userid' AND win='1'"));

 

would i just do that for every option in the database?

Link to comment
https://forums.phpfreaks.com/topic/217848-take-from-mysql/
Share on other sites

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.