Ouch.. a memory limit of only 16MB?? The default for a new installation of PHP is something like 128 MB, IIRC. I'm assuming you have access to the php.ini file, correct? If so, open it and search for the "memory_limit" directive in there - change it to something like 64M or 128M.
EDIT: Also note that you could try to write code that uses memory more efficiently. For example, after this code:
$nameArray = $firstLastNames->fetchAll();
$first = $nameArray[0][0];$last = $nameArray[0][1];$email = $nameArray[0][2];
You're left with an array and a SQL resource that you never use again. As for the former of the two, you could either a) use an associative array e.g. $nameArray[0]['First_Name'] rather than duplicate the data in separate variables, or b) use [man]list/man to create the variables without an intermediate array, e.g.:
list($first, $last, $email) = $firstLastNames->fetchRow();
.
As for the second, you could call the "free()" method and re-use the same variable to execute queries rather than creating new ones for each query, though I don't think that resource pointers take up too much memory.