%in = map { $_ => $q->param($_) } $q->param; if ($in{'submit'} ne 'New Entry') { . . $requestID = $in{'requestID'}; $sql = "SELECT title, firstname, lastname, address1, address2, city, state, zipcode, zipextra, phonehome, phonework, phonecell, email, username, role, approved FROM members WHERE UID = $requestID"; ....code to generate table with the values from the db inserted into the fields... } else { ....code to generate table with empty fields... }