I'm using a text area on a form so people can make comment then on another page it is being echo from the Database. I have column about 12% of page it displays in. If the person writing in the textarea and doesn’t carriage return at the end of the textarea box the resulting sentence displays across the hole page instead of just 12%. How do I create the textarea box so it only allow say 25 characters then automatically goes to a new line.
For excample if this was typed into the textarea it would go accross the hole way, but if the same was like i need it it might look more like the.
For excample it this was typed
into the textarea it would go
accross the hole way, but if the
same was like i need it it might
look more like this.
Here the php that displays the result from DB
mysql_connect($hostname,$username,$password);
@mysql_select_db($dbname) or die( "Unable to select database");
$query = 'DELETE FROM HeadLineNews WHERE DATE_SUB(CURDATE(),INTERVAL 1 DAY) <= `Date_Submitted`';
mysql_query($query);
$query= 'SELECT First_Name, Last_Name, Position, HeadLine, News, NewsII, IP, Date_Submitted FROM HeadLineNews ORDER BY Date_Submitted DESC LIMIT 0, 100';
$result=mysql_query($query);
$num=mysql_numrows($result);
if ($num==0) {
echo "<b>No News</b><br>";
}else{
echo "<b>News</b><br>";
}
mysql_close();
$i=0;
while ($i < $num) {
$First_Name=mysql_result($result,$i,"First_Name");
$Last_Name=mysql_result($result,$i,"Last_Name");
$HeadLine=mysql_result($result,$i,"HeadLine");
$News=mysql_result($result,$i,"News");
$NewsII=mysql_result($result,$i,"NewsII");
$IP=mysql_result($result,$i,"IP");
$Date_Submitted=mysql_result($result,$i,"Date_Submitted");
echo "<b>$HeadLine</b><br>$News<br><br>$NewsII<hr>";
$i++;
}
?>
Hers the textarea field
<textarea name='News' rows=7 cols=25></textarea>