Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

php game stats

Codes here !

Moderators: macek, egami, gesf

php game stats

Postby numnut3000 » Fri Nov 30, 2012 12:02 pm

hi everyone thanks for looking in

im trying to make some game stats and this part i really cant get my head around im looking
to have a result like this " today (date) you have killed 23 (kills) enemies your average kill is 1 kill per 1 min and 24 secs"
how can work this out ?
thanks


<?php
include("connect.php");
$data_array = "";
$i=0;
//$member="numnut";

if (isset($_POST['myrequest'])&&$_POST['myrequest']== "get_data_array"){
$results=mysql_query("SELECT * from gamestats WHERE member='numnut'");

while($row = mysql_fetch_array($results)){
$i++;
$member=$row["member"];
$date=$row["date"];
$kills = $row["kills"];
if($i == 1){
$data_array .= "$member|$date|$kills";
}else{
$data_array .= "(||)$member|$date|$kills";


}
}

echo "returnstring=";echo"$data_array";
//exit();
}
?>
numnut3000
New php-forum User
New php-forum User
 
Posts: 1
Joined: Fri Nov 30, 2012 11:46 am

Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.