Does anyone know why I would get the following error:
Parse error: parse error, expecting T_STRING' orT_VARIABLE' or `T_NUM_STRING' in /home/www/html/xxx.xxxx.ca/sites/put/php/teams/delete.php on line 15
while running the code:
14 while ($row = mysql_fetch_array($result)) {
15 $query = "UPDATE $table SET myID = $count WHERE id = $row['id']";
16 mysql_query($query) or die(mysql_error());
17 $count++;
18 }
I've also tried the following for line 15:
$query = "UPDATE '$table' SET myID = $count WHERE id = '{$row["id"]}'";
and various combinations of quotes around table, count, row and id (inside row). Certain combinations produce the error mentioned above, while others produce the error:
You have an error in your SQL syntax near 'WHERE id='4785'' at line 1
Any suggestions are greatly appreciated!