I'm attempring to save the keys of mysql records in an array but get the Fatal Error: Can't use function return value in write context.. The code is:

for ($i = 0; $i < $tranrows; ++$i)
{ $tranrec = mysql_fetch_row($tranresult);
  $keyarray($i) = $tranrec[0];

I've done all the mysql code OK; just trying to save the first field of the SELECTed record into an array for subsequent processing. If I remove the $tranrec[0] assignment everything works fine.