In mysql obtain the necessary data via the use of a select statement...something like:
select datafortextfield from table1 where ........
Using the information returned from this then you can place this in a textarea by
<textarea rows="20" cols="20"><?php print $valuereturned; ?></textarea>
or into a textfield as
<input type="text" size="20" value="<?php print $valuereturned; ?>"></input>