跳棋板我一直在試圖讓MySQL處理板的數據,如位置和具有板在板PHP使得從MySQL
有值,如
告示牌上的黑色和紅色的碎片行8至1分 和 列A至H
於是我可以使用MySQL到板之間移動
問題: 如何轉換該陣列分成MySQL的,因此它可以具有板行,然後列數據,以行和列,這樣我可以顯示件,並使用這些值來移動,在板件
function displayboard(){
$Board = array
(
array(0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0),
);
$row = 0;
print "<form>";
print "<table border = 1>";
while ($row < 8){ // Counts to 8. (from 0...7 = 8 times. 0 ... 8 = 9 times)
print "<tr>";
$row++;
$col = 0; // reset column to 0 each time printing one row.
while ($col < 8){
print "<td>";
if($Board[$row][$col] == 0)
{
print "<input type=\"checkbox\" name=\"box[]\" value=\"$value\">";
// Add \ before " otherwise it will treat as the end of the quote.
}
print "</td>";
$col++;
}
print "</tr>";
}
print "</table>";
print "</form>";
}
對不起,請問是什麼問題? – 2010-11-03 15:02:22
對不起如何轉換數組到MySQL,因此可以得到董事會行,然後列數據的行和列,這樣我可以顯示片,並使用這些值時,你的意思是二進制移動,在板件 – hgbso 2010-11-03 15:04:03