I am trying to update the field id_key which is an unique value using uniqid() function. When I print to the screen the value for uniqid() [$id] is different for each record. Which is correct and is what I want.
However when I go inspect the table all the values in the id_key column are the same for each record. What am I doing wrong? Each record should have a different value - the value shown on the screen with my echo statement.
while ($row = mysql_fetch_array($loop))
{
$id = uniqid();
echo $row['rec'] . " " . $row['first_name'] . " " . $row['email'] . " " . $id . "<br/>";
$query="UPDATE va SET id_key='$id'";
mysql_query($query) or die ("Error in query: $query <br>" . error_message);
}