tgavin Posted March 23, 2007 Share Posted March 23, 2007 I want to display the results of a loop in a textarea. It's working, except that the textarea is printing in the wrong area of my page. Is there a way that I can just get the contents into a variable, or array, or something that I can insert elsewhere in the page? echo '<textarea name="printsubs" id="printsubs" cols="50" rows="20">'; while($row = mysql_fetch_assoc($sql)) { echo $row[''.SUB_EMAIL.'']."\n"; } echo '</textarea>'; Link to comment https://forums.phpfreaks.com/topic/44004-solved-turn-results-of-while-liio-into-variable/ Share on other sites More sharing options...
per1os Posted March 23, 2007 Share Posted March 23, 2007 <?php $txtArea = '<textarea name="printsubs" id="printsubs" cols="50" rows="20">'; while($row = mysql_fetch_assoc($sql)) { $txtArea .= $row[''.SUB_EMAIL.'']."\n"; } $txtArea .= '</textarea>'; ?> Link to comment https://forums.phpfreaks.com/topic/44004-solved-turn-results-of-while-liio-into-variable/#findComment-213665 Share on other sites More sharing options...
tgavin Posted March 23, 2007 Author Share Posted March 23, 2007 thank you! Link to comment https://forums.phpfreaks.com/topic/44004-solved-turn-results-of-while-liio-into-variable/#findComment-213698 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.