theoneweasel77
Programmer
can someone look at this function and tell me what's wrong? I'm getting the following error:
Parse error: parse error, unexpected T_VARIABLE in (file name) on line 13
Parse error: parse error, unexpected T_VARIABLE in (file name) on line 13
Code:
function store_data($db, $ID, $color, $moves)
{
for($i = 1, $foo = 0; $i <= 12; $i++, $foo += 2)
{
$foo2 = $foo + 1;
$move_from = "move".$i."from";
$move_to = "move".$i."to";
$piece_update = mysql_query("UPDATE `moves` SET `$move_from` = '$moves[$foo]', `$move_to` = '$moves[$foo2]' WHERE `ID` = '$ID' && `color` = '$color'", $db);
print mysql_error();
/* line 13 */ print_r $moves;
print $moves[$foo];
}
}