# I need the members information for their profile update... #$_un carries the username they are logged in as: $sth = $dbh->selectrow_array(qq{select * from `members` where `USERNAME` = ? LIMIT 1}); $sth->execute($_un); my $_mbrInfo = $sth->fetchrow_hashref(); $sth->finish(); # then go build the html page and form for them to update their profile, prepopulating the data that is already in their #### $sth = $dbh->selectrow_array(qq{select * from `members` where `USERNAME` = ? LIMIT 1}); $sth->execute($_un); my $_mbrInfo = $sth->fetchrow_hashref(); $sth->finish(); # Got member record, now get their billing address: $sth = $dbh->prepare(qq{select * from `shippingAddresses` where `mid` = ?}); $sth->execute($_mbrInfo->{mid}); my $_addy = $sth->fetchrow_hashref(); $sth->finish(); #### # Get Members Id, Name, Phone, Email: my($_mbrId,$_mbrName,$_mbrPhone,$_mbrEmail) = $dbh->selectrow_array(qq{select `mid`,`name`,`phone`,`email` from `members` where `USERNAME` = ?}, undef, $_un); #### # Get address: $sth = $dbh->selectrow_array(qq{select * from `shippingAddresses` where `Id` = (select `mid` from `members` where `USERNAME` = ?)}); $sth->execute($_un); my $_addy = $sth->fetchrow_hashref(); $sth->finish();