in reply to INSERT Problem

You have the prepare and execute inside the loop commented out, and only the one outside the loop is active.

Whoa! I just realized the prepare statement in the loop overwrites the $sth you use for fetching. Use another name for the handle, like $ins.

Incidentaly, you could move the prepare statement before the loop, if you did it like this:

$sql="INSERT INTO email (f_name, l_name, code, ext, email) VALUES (?, ?, ?, ?, ?)"; $ins=$dbh->prepare($sql);
and replace the execute with
$sth->execute($FNAME, $LNAME, $STR, $CT5, $EMAIL) || die $sth->errstr;
Not only is that more maintainable (IMHO), but it should also be faster, since it only has to parse the SQL statements once. In addition, it protects you from things like single quotes in your input.