$query=$dbh->prepare($SQLstatement); $query->execute(); $row=$query->fetchrow_hashref; $storedProfile = {}; $storedProfile{user_id} = $row->{user_id}; # copy over each item from the result row $query->finish();