I've only recently started php again, this is supposed to add another game to a chess game database and it's supposed to add all squares as empty, the squares in the database are saved as i0,i1..i63, turno is true when it's white's turn, otherwise false, and the primary key is not metioned here as it's auto increment.
<?php
mysql_connect("localhost","pierostesting","");
mysql_select_db("my_pierostesting");
$query = "INSERT INTO board(";
for($i=0;$i<64;$i++){
$query.="i$i,";
}
$query.="turno) VALUES(";
for($i=0;$i<64;$i++){
$query.="'empty',";}$query.="1)";
echo $query;
if(mysql_query($query)){
echo 'nailed it';
}?>