[herlp]hero status script
Posted: Thu Oct 27, 2011 1:21 am
Hi i got this hero status script from one of the topic here, and could someone help me to add class name and clan_name ? i saw the same topic with this, but non is working, but i only need to add is character class and character clan name.. thanks ..
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html" charset="Windows-1251"> <meta http-equiv="Content-Style-Type" content="text/css"> <title>: Hero's</title> </head> <body bgcolor="#000000" style="color:#999999; font-family:verdana;"> <?php $db_user = "root"; //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 = "3306"; //the address of the database goes here $res = mysql_connect ( $db_serv, $db_user, $db_pass, $db_port ) or die ("Coudn't connect to server."); mysql_select_db ( $db_name ) or die ('Couldnt select database.'); //------------------------------------------------------------------------------------------------------------------------------------------------- $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=2 align=center class=\"content\" style=\"font-size:12px; font-family:verdana; color:#FFFFFF;\"><b>Heroes</b> </td> </tr> <tr> <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>Clan Name</b></center></td> <td style=\"font-size:12px; border:1px #999999 solid;\"><center><b>Count</b></center></td> </tr>"; $query = mysql_query("SELECT charId,count FROM heroes WHERE count >=1 ORDER BY count DESC") or die('Query failed!'); while ($res=mysql_fetch_array($query)) { $id=$res['charId']; $count=$res['count']; $char_name=mysql_query("SELECT char_name FROM characters WHERE charId='$id'"); $name = mysql_fetch_row( $char_name ); $FORM2 .= '<tr> <td style=\"font-size:10px; font-family:verdana; color:#999999;\" class=content align=center>'.$name[0].'</td> <td style=\"font-size:10px; font-family:verdana; color:#999999;\" class=content align=center>'.$res['count'].'</td> </tr>'; } echo $FORM2; mysql_close(); ?> </body> </html>