Guys i need some help with a ODBC :P

Joined
Jul 16, 2008
Messages
861
Reaction score
25
Ok, im in troubles, i want all the Scripts and things on my site but only 1 thing i cant directly connect to my mssql db so i need to do it to ODBC :P now the thing is.. i got the ODBC connection script and it works for register :P But i want to get it for ranking pages etc.

This is what i tryd,

Code:
<html>
<head>
<title>NLGunz ~ Ranking Pagina</title>
</head>
<body bgcolor="#000000" text="#FFFFFF" alink="#FFFFFF" vlink="#FFFFFF" link="#FFFFFF" onselectstart="return false" oncontextmenu="return false" style="cursor: crosshair">

<?php 
$dns="GunzDB";
$user="sa";
$pass="Trythis :P";
$connect=odbc_connect($dns, $user, $pass) or die ("Couldn't connect to the database, we're sorry...");
odbc_exec($connect,"use GunzDB");

function antisql($bericht){
$bericht = stripslashes($bericht); 
$bericht = htmlspecialchars($bericht); 
$bericht = nl2br($bericht); 
return $bericht;
}

?>
<link rel="stylesheet" type="text/css" href="style.css"> 
<?php 
$query = @mssql_query ("SELECT TOP 50 Name,Level,XP,KillCount,DeathCount,PlayTime,BP from Character WHERE AID!='$ADM' order by XP desc");


?>
<style type="text/css">
<!--
.style28 {font-size: 12px}
.style29 {color: #000000; font-weight: ; font-size: 5px; }
.style1 {	font-size: 12px;
	font-weight: ;
}

</style>
<body bgcolor="#000000" text="#FFFFFF" style="scrollbar-face-color:#000000;
scrollbar-shadow-color:#5F5752;
scrollbar-highlight-color:#5F5752;
scrollbar-3dlight-color:#5F5752;
scrollbar-darkshadow-color:#000000;
scrollbar-track-color:#000000;
scrollbar-arrow-color:#5F5752;">
<table width="1000" height="1000" background="ranking_table_bg.jpg">
<td>
<table border="1" bordercolor="#000000"align="center" cellpadding="0" cellspacing="0" width="750" height="900">
  <tr>
    <th scope="row"><strong>Nº</strong></td>
    <th scope="row"><strong><?php echo NAME;?></strong></td>
    <th scope="row"><strong><?php echo LEVEL;?></strong></th>
    <th scope="row"><strong><?php echo EXP;?></strong></th>
    <th scope="row"><strong><?php echo KILLS;?></strong></th>
    <th scope="row"><strong><?php echo DEATHS;?></strong></th>
    <th scope="row"><strong><?php echo TIME;?></strong></th>
	<th scope="row"><strong><?php echo BOUNTY;?></strong></th>

  </tr>
  <?php 
 for($i=0;$i < mssql_num_rows($query);++$i)
{
$row = @mssql_fetch_row($query);
$rank = $i+1;
$nome = $row[0];
$nivel = $row[1];
$xp = $row[2];
$kill = $row[3];
$mortes = $row[4];
$time = number_format ($row[5] / 60 / 60, 2);
$bounty = $row[6];

  ?>
  <tr> 
    <th width="5%" height="1" scope="rank" bordercolor="#FFFFFF"><strong><font size="2" color="lime"><?php echo "$rank";?></strong></th>
    <th width="15%" height="1" valign="middle" bordercolor="#FFFFFF"><p align="center"><font size="2"><a href="#"><?php echo "$nome";?></a></p>
    
    <td width="10%" height="1" bordercolor="#FFFFFF"><p align="center"><font size="2"><?php echo "$nivel";?></p></td>
    <td width="10%" height="1" bordercolor="#FFFFFF"><p align="center"><font size="2"><?php echo "$xp";?></p></td>
    <td width="10%" height="1" bordercolor="#FFFFFF"><p align="center"><font size="2"><?php echo "$kill";?></p></td>
    <td width="10%" height="1" bordercolor="#FFFFFF"><p align="center"><font size="2"><?php echo "$mortes";?></p></td>
    <td width="10%" height="1" bordercolor="#FFFFFF"><p align="center"><font size="2"><?php echo "$time";?></p></td>
    <td width="10%" height="1" bordercolor="#FFFFFF"><p align="center"><font size="2"><?php echo "$bounty";?></p></td>

  </tr>
  <?php }?>
</table>
</table>
</body>
</html>

Is this right some1 can edit it for me? plz :D
 
Back