You haven't put any quotes around the string.
It should be.
$str = '<a href ="index.php?iid='.$row['image_id'].$row['image_name'].'></a>';
Although I'm guessing it's supposed to be something like.
$str = '<a href ="index.php?iid='.$row['image_id'].'&iname='.$row['image_name'].'></a>';
HTH
Bubble