<?php
	$query = "SELECT p.id as pid, p.name as pname, p.rank as prank, v.id as vid, ((v.kills1+v.rk1)/v.deaths1)+((v.kills1+v.rk1)*60/v.time1) as kd FROM vehicles as v, player as p WHERE v.id=p.id AND v.time1 > 90000 AND p.time > 360000 ORDER BY kd DESC LIMIT 5";

$query2 = "SET @n:=0";
$query3 = str_replace("FROM", ", @n:=@n+1 as num FROM", $query);
$query3 = str_replace("LIMIT 5", "", $query3);
?>
