Código HTML:
<html> <head> <meta http-equiv="Content-Type" content="text/html" charset="Windows-1251"> <meta http-equiv="Content-Style-Type" content="text/css"> <title>PvP Stats</title> </head> <body bgcolor="#000000" style="color:#999999; font-size:11px; font-family:verdana;"> <?php include("Connection.php"); //Do not remove this header //This script package is distributed by kadar of L2j.sourceforge //You are free to distribute this package as long as the headers stay intact. $FORM2 = "<table width=400 style=\"font-size:11px; font-family:verdana; color:#999999;\" cellspacing=\"0\" cellpadding=\"0\" align=center> <tr> <td width=100% height=34 colspan=3 align=center class=\"content\" style=\"font-size:12px; font-family:verdana; color:#999999;\"><b>PvP Stats - Top 50<br><br></b> </td> </tr> <tr> <td style=\"font-size:12px; border:1px #999999 solid;\"><center><b>Position</b></center></td> <td style=\"font-size:12px; border:1px #999999 solid;\"><center><b>Name</b></center></td> <td style=\"font-size:12px; border:1px #999999 solid;\"><center><b>Kills</b></center></td> </tr>"; $activity = mysql_query("SELECT characters.pvpkills,characters.char_name FROM characters Where ((characters.pvpkills >=1) AND (characters.accesslevel = 0)) ORDER BY characters.pvpkills DESC limit 50"); $i = 1; while($row = mysql_fetch_array($activity)) { $FORM2 .= '<tr> <td style=\"font-size:10px; font-family:verdana; color:#999999;\" class=content align=center>'.$i.'</td> <td style=\"font-size:10px; font-family:verdana; color:#999999;\" class=content align=center>'.$row['char_name'].'</td> <td style=\"font-size:10px; font-family:verdana; color:#999999;\" class=content align=center>'.$row['pvpkills'].'</td> </tr>'; $i++; } echo $FORM2; ?> </body> </html>
Código:
<?php //Do not remove this header //This script package is distributed by kadar of .sourceforge //You are free to distribute this package as long as the headers stay intact. // //This file must stay in the parent directory of the script folder //and must be filled out correctly for the scripts to work. // //It is suggested to make a new user and pass for the scripts //and set the permissions to select only. $db_user = ""; //your sql username goes here $db_pass = ""; //your sql password goes here $db_name = ""; //your database name goes here $db_serv = "localhost"; //the address of the database goes here $db_port = ""; //the address of the database goes here $res = mysql_connect ( $db_serv, $db_user, $db_pass, $db_port ) or die ("Coudn't connect to [$db_serv]"); mysql_select_db ( $db_name ); ?>