# Displaying MySQL table data in a textarea

**URL:** https://forum.kirupa.com/t/displaying-mysql-table-data-in-a-textarea/222881
**Category:** programming
**Created:** [April 17, 2007, 6:47pm UTC](https://forum.kirupa.com/t/displaying-mysql-table-data-in-a-textarea/222881 "2007-04-17T18:47:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jpearson311](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jpearson311](https://forum.kirupa.com/u/jpearson311)
#### Post date: [April 17, 2007, 6:47pm UTC](https://forum.kirupa.com/t/displaying-mysql-table-data-in-a-textarea/222881/1 "2007-04-17T18:47:08Z")

</div>

Hello all:

I’m trying to display all of the email addresses I have in one mysql database table in a textarea. I’ve been using the following code:

```auto
 $result = mysql_query('SELECT * FROM `email` WHERE 1 LIMIT 0, 30 ');
<?php while($row = mysql_fetch_array($result)){ ?>
<textarea name="textarea" cols="" rows="" wrap="virtual"><?php echo $row['email']; ?></textarea>

```

When I view it, I want all of the email addresses to show in one textarea, but it is presently duplicating the textarea based off of how many addresses there are in the table. I know it has to do with improper use of mysql\_fetch\_array, but I’m not sure where or how.

Any help would be appreciated. Thanks.

JPearson311
