Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
OK some reason I cannot display my query when I use
HTML
<textarea>


PHP
while($row = mysql_fetch_array($result_reviews))
       {
           echo "<td>" .$row['username']. "</td>";
           echo "<td>" .$row['title']. "</td>";
           //echo "<td>" .$row['review']. "</td>";
           echo "<td><textarea rows="8" cols="50">" .$row['review']. "</textarea></td>";

           echo ("<td><a href=\"editreview.php?id=$row[id]\">
               <button>Edit Review</button></a></td>");

           echo ("<td><a href=\"delete.php?id=$row[id]\">
               <button>Deleat Review</button></a></td></tr>");
       }


As you can see I have commented out one line and replaced it with
HTML
<textarea>

This is where it goes wrong and will not display.
any idea why? and how to get it to work.
Posted
Updated 22-Jan-14 3:21am
v2

Hello,

It's been a while since I've had a play with php.
Looking at the code you posted, you might want to try escaping those double quote characters that wrap the textarea size parameters.

PHP
while($row = mysql_fetch_array($result_reviews))
	    {
	    	echo "<td>" .$row['username']. "</td>";
	        echo "<td>" .$row['title']. "</td>";
	        //echo "<td>" .$row['review']. "</td>";
	        echo "<td><textarea rows=\"8\" cols=\"50\">" .$row['review']. "</textarea></td>";
 
	        echo ("<td><a href=\"editreview.php?id=$row[id]\">
	        	<button>Edit Review</button></a></td>");
 
	        echo ("<td><a href=\"delete.php?id=$row[id]\">
	        	<button>Deleat Review</button></a></td>");
	    }
 
Share this answer
 
v4
fixed

PHP
echo "<table><tbody><tr><td><textarea rows=\"8\" cols=\"50\">" .$row['review']. "</textarea></td></tr></tbody></table>";
 
Share this answer
 
Comments
hypermellow 22-Jan-14 9:42am    
Glad your all sorted now!
Ben Oats 22-Jan-14 10:00am    
Thank you, I tried to reply to yours but it did not allow me, thanks for your answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900