Help Script

05/26/2015 21:44 Apero#1
hello
I explained my concern
So I am doing a record bosss
My bosss by bosss
I show you my script
I fail to understand why it is not working



PHP Code:
<?php 
function mssql_escape_string($data) { 
if(!isset(
$data) or empty($data)) return ''
if(
is_numeric($data)) return $data
$non_displayables = array( 
'/%0[0-8bcef]/'// url encoded 00-08, 11, 12, 14, 15 
'/%1[0-9a-f]/'// url encoded 16-31 
'/[\x00-\x08]/'// 00-08 
'/\x0b/'// 11 
'/\x0c/'// 12 
'/[\x0e-\x1f]/' // 14-31 
); 
foreach(
$non_displayables as $regex
$data preg_replace($regex,'',$data); 
$data str_replace("'","''",$data); 
return 
$data



$host '127.0.0.1'
$dbuser 'Shaiya';
$dbpass 'Shaiya123'
$database 'PS_GameLog'
$conn = @odbc_connect("Driver={SQL Server};Server=$host;Database=$database"$dbuser$dbpass) or die("Database Connection Error!"); 
$res odbc_exec($conn"SELECT TOP 1 [Text1], [Text3], [ActionTime] FROM PS_GameLog.dbo.ActionLog WHERE Value3=3350 AND MapID=18 AND ActionType=173 AND [Text2]='death'order by ActionTime desc"); 
$detail=odbc_fetch_array($res); 
if (
odbc_num_rows($res)==0); 
else{ 
echo 
"



<center>Boss records 
<table cellspacing=1 cellpadding=2  border=1 style=\"border-style:hidden;\"> 
<tr> 
<th>Tuer par</th> 
<th>Nom Boss</th> 
<th>Heure de la mort</th> 
</tr>"

while(
$row odbc_fetch_array($res)) 

echo 
"<tr>"
echo 
"<td>"$row['Text3'] ."</td><td>"$row['Text1'] ."</td><td>"$row['ActionTime'] ."</td>"
echo 
"</tr>"

echo 
"</table></center>"

?>

Thank you in advance to anyone who could help me
05/26/2015 22:10 SkuulCandy#2
Your sql code is false, take this php code (not html + php ;))
[Only registered and activated users can see links. Click Here To Register...]
05/26/2015 22:19 Apero#3
I just noticed that he very well the script function
The concern is that not indicate the final kill
when I my SELECT TOP 5 it tells me the 4th not the latest
05/26/2015 22:41 Apero#4
[Only registered and activated users can see links. Click Here To Register...]
05/26/2015 23:23 momocruz#5
Quote:
Originally Posted by Apero View Post
[Only registered and activated users can see links. Click Here To Register...]
Tu as juste à inversé l'ordre d'affichage au lieu du 1 er au dernier tu ranges par le dernier au 1er

Change this line
PHP Code:
$res odbc_exec($conn"SELECT [Text1], [Text2], [Text3], [MapID], [ActionTime] FROM ActionLog WHERE [ActionType]='173' AND [Text2]='death'order by ActionTime desc"); 
for this
PHP Code:
$res odbc_exec($conn"SELECT [Text1], [Text2], [Text3], [MapID], [ActionTime] FROM ActionLog WHERE [ActionType]='173' AND [Text2]='death'order by ActionTime asc"); 
Voila
05/26/2015 23:35 Apero#6
Non en faite le s'a m'indique l'avant dernier mort mes pas le dernier
05/27/2015 14:00 Apero#7
After some modification
This is the result
But I have a concern that he shows me the last but not the death my last


PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<style type="text/css"> 
<table style="background-color : transparent;">
html, body {height:100%; margin:0; padding:0;} 
#page-background {position:fixed; top:0; left:0; width:100%; height:100%;} 
#content {position:relative; z-index:1; padding:10px;} 
body,td,th { 


</style> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
</head> 
<body text="#000000"> 


<center><div id="page-background"><img src="kimu.gif"  width="200" height="200" alt=""></div> 
<div id="content"> 
<?php 
function mssql_escape_string($data) { 
if(!isset(
$data) or empty($data)) return ''
if(
is_numeric($data)) return $data
$non_displayables = array( 
'/%0[0-8bcef]/'// url encoded 00-08, 11, 12, 14, 15 
'/%1[0-9a-f]/'// url encoded 16-31 
'/[\x00-\x08]/'// 00-08 
'/\x0b/'// 11 
'/\x0c/'// 12 
'/[\x0e-\x1f]/' // 14-31 
); 
foreach(
$non_displayables as $regex
$data preg_replace($regex,'',$data); 
$data str_replace("'","''",$data); 
return 
$data



$host '127.0.0.1'
$dbuser 'Shaiya';
$dbpass 'Shaiya123'
$database 'PS_GameLog'
$conn = @odbc_connect("Driver={SQL Server};Server=$host;Database=$database"$dbuser$dbpass) or die("Database Connection Error!"); 
$res odbc_exec($conn"SELECT TOP 2 [Text1], [Text3], [ActionTime] FROM PS_Gamelog.dbo.ActionLog WHERE Value3=3347 AND  ActionType=173 AND [Text2]='death'order by ActionTime desc"); 
$detail=odbc_fetch_array($res); 
if (
odbc_num_rows($res)==0); 
else{ 
echo 
"



<center> Villarica
<table cellspacing=1 cellpadding=2  border=1 style=\"border-style:hidden;\"> 


<tr> 
<th>Tuer par</th> 
<th>Heure de la mort</th> 
</tr>"

while(
$row odbc_fetch_array($res)) 

echo 
"<tr>"
echo 
"<td>"$row['Text3'] ."</td><td>"$row['ActionTime'] ."</td>"
echo 
"</tr>"

echo 
"</table></center>"

?>

This is the result
When I asked TOP 2
And he gives a

[Only registered and activated users can see links. Click Here To Register...]


If anyone can find out the top
05/27/2015 15:03 SkuulCandy#8
Tu veux qu'il affiche uniquement 1 boss ou plusieurs que tu veux ou bien toutes une palanqué ?

You want to display only one or more bosses you want all of boss ?
05/27/2015 15:40 Apero#9
No 1 I will only make a script by boss
my the only thing that works is not it not indicate that the latest death in my penultimate

Look when I made the sql database it really shows me the last 2 dead


[Français]
Non 1 seul je vais faire un script par boss
mes la seul chose qui fonctionne pas c'est que il indique pas la derniere mort mes l'avant derniere

Regarde quand je fait sql sur la database il m'indique bien les 2 dernier mort
[Only registered and activated users can see links. Click Here To Register...]

While not on the php script


[Français]
Alors que sur le script php non


[Only registered and activated users can see links. Click Here To Register...]
05/27/2015 19:27 SkuulCandy#10
Ah ok, donc tu voudrais qu'il affiche les 2 dernières morts ? A ce moment la faudrait faire a en sorte d'afficher deux lignes. Là il y en a qu'une.