I have a php script like this
pvp.php
<?
include("config.php");
include("gecir.php");
if(($startl == "") or ($stopl == "")) {
$startl=0;
$stopl=50;
}
?>
<html>
<head>
<meta http-equiv="Content-Language" content="tr">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1254">
</head>
<body bgcolor="#FFFFD2">
<div align="center"><br><br>
<center>
<form method="POST" action="arama.php"><font face="Tahoma" size="2">
Kullanici Arama: <input type="text" name="user" size="25" style="font-family: Tahoma;font-size: 10px; font-weight: bold">
<input type="submit" value="Ara" name="Ara" style="font-family: Tahoma; font-size: 10px; font-weight: bold">
</center></form>
<br>
<form method="POST" action="uopvpstats.php"><font face="Tahoma" size="2">
<input type="text" name="startl" size="7" value="<? echo $startl;?>" style="font-family: Tahoma;font-size: 10px; font-weight: bold"> ile
<input type="text" name="stopl" size="7" value="<? echo $stopl;?>" style="font-family: Tahoma;font-size: 10px; font-weight: bold"> arasýnda
<input type="submit" value="goster" name="Göster" style="font-family: Tahoma;font-size: 10px; font-weight: bold">
</form>
<br>
</div>
<div align="center">
<center>
<table border="1" width="60%" cellspacing="0" cellpadding="0" bordercolor="#000000">
<tr>
<td width="11%" align="center" bgcolor="#C0C0C0"><font face="Tahoma" size="2"><b>Siralama</b></font></td>
<td width="30%" align="center" bgcolor="#C0C0C0"><font face="Tahoma" size="2"><b>Kullanýcý
Adý</b></font></td>
<td width="11%" align="center" bgcolor="#C0C0C0"><font face="Tahoma" size="2"><b>Puani</b></font></td>
<td width="35%" align="center" bgcolor="#C0C0C0"><font face="Tahoma" size="2"><b>Guild</b></font></td>
<td width="11%" align="center" bgcolor="#C0C0C0"><font face="Tahoma" size="2"><b>Kill Sayisi</b></font></td>
</tr>
<?
$result = mysql_query("SELECT id FROM pvp");
$num_rows = mysql_num_rows($result);
echo "Istatistik Sistemine Kayýtli Toplam Oyuncu: $num_rows<br>";
$pfix = "LIMIT $startl , $stopl";
$result = mysql_query( "SELECT account,name,puan,guild,kills FROM pvp order by puan desc $pfix");
$where="";
$a = $startl;
WHILE ($row=mysql_fetch_array($result)) {
$a++;
$salaksco = $row['account'];
$appsco = $row['name'];
mysql_query("UPDATE pvp SET siralama='$a' WHERE account='$salaksco' and name='$appsco'");
if($row['kills']>=6)
$bgcol="#FF0000";
else
$bgcol="#00FF00" ;
?>
<tr>
<input type="hidden" name="id" value="<?=$row['id']?>">
<td width="20%"> <? echo "$a" ?></td>
<td width="29%" bgcolor="<?=$bgcol?>"> <?=$row['name']?></td>
<td width="27%"> <?=$row['puan']?></td>
<td width="31%"> <?=$row['guild']?></td>
<td width="11%" align="center"><?=$row['kills']?></td>
</tr>
<?php } ?>
</table>
</center>
</div>
<p> </p>
</body>
</html>
config.php
<?
$uname="Dakkar";
$pw="";
$server="localhost";
$db="uopvp";
$table="pvp";
mysql_connect($server,$uname,$pw) or die("Server girilemedi");
mysql_select_db($db) or die("Database Seçilemedi");
?>
gecir.php
<?
@mysql_connect("localhost", "Dakkar", "")
or die("Veritabani ile baglanti kurulamadi!");
@mysql_select_db("uopvp")
or die("Veritabaninda bir hata olustu!");
$lines = file("C:\Serverlar\SphereR402\pvp.txt");
$i=0;
foreach ($lines as $line_num => $line) {
$i++;
}
for ($x=0;$x<$i;$x++) {
list($account, $name, $puan, $kills, $guild) = explode(" ",$lines[$x]);
$sql = "SELECT count(*) FROM pvp WHERE account='$account' and name='$name' ";
$res = mysql_query($sql) OR die(mysql_error());
$row = mysql_fetch_row($res);
if($row[0] == 0) {
@mysql_query("insert into pvp values('','$account','$name','$puan','$guild','$kills','')");
}
else {
mysql_query("UPDATE pvp SET puan='$puan' WHERE account='$account' and name='$name'");
mysql_query("UPDATE pvp SET guild='$guild' WHERE account='$account' and name='$name'");
mysql_query("UPDATE pvp SET kills='$kills' WHERE account='$account' and name='$name'");
}
}
unlink("C:\Serverlar\SphereR402\pvp.txt");
$dosya=fopen("C:\Serverlar\SphereR402\pvp.txt","w");
fclose($dosya);
?>
when i try to run pvp.php im taking an error like this
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'n'' at line 1
why should it be?