<?php
include_once"scripts/connect.php";
$sql = mysql_query("SELECT * FROM Tabletest ORDER BY Points DESC, PP DESC, Name ASC");
$pos=1;
while($pos <= 16){
$row = mysql_fetch_array($sql);
$Points = $row['Points'];
$PP = $row['PP'];
$Name = $row['Name'];
mysql_query("UPDATE Tabletest SET thiswp=".$pos." WHERE Points=".$Points." PP=".$PP." Name=".$Name."");
echo "$pos $Points $Name $PP <br/> \n";
$pos = $pos + 1;
}
?>
這呼應了我所期望的,即UPDATE SET語法PHP
Position Points Name PP
1 5 John 55
2 4 Bob 54
3 4 Jane 54
4 3 Rob 50
etc
但它不更新Tabletest - 在thiswp字段爲空。我在哪裏搞砸了? Cheers Rich
SQL注入檢測 – 2012-03-11 00:56:26
對不起我的頭 - 你的意思是它容易受到SQL注入?或者它與「SQL注入檢測」錯誤 – user1224642 2012-03-11 01:12:55
它很容易受到sql注入 – 2012-03-11 01:13:26