Hi another little question guys:
I have a multi dimensional array set like this:
teams[1][p]
teams[1][s]
teams[2][p]
teams[2][s]
...
what I am trying to do is use foreach loop to loop through the first element teams[x] and assign the other 2 elements in the process.
This is the first time I am using foreach loop and man page for this function confuses me a bit. the following doesnt work and I would appreciate some input:
Code:
foreach ($teams as $v)
{
mysql_query("UPDATE teams SET tplayed=" . $teams[$v]['p'] . ",tpoints=" . $teams[$v]['s'] . "WHERE t_id=" . $v) or die("Query failed with error: ".mysql_error());
}
Thanks for help.
bodis