I'm not really sure if this is a PHP or MySQL issue...
I have a field on my form that contains a lot of text. The text is stored in a MySQL field, currently set to longtext (although, I've tried longblob as well).
Upon form submission, the data is stored fine. But when retrieving it for edits, the beginning of the text is truncated. I'm not quite sure why this is happening.
Here's the code that retrieves the data:
/**** First, I replace the <br /> tag ****/
$query = "SELECT * FROM listings WHERE ID='$lid'";
$result = mysql_query($query);
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) {
$cD2 = stripslashes($row['Description']);
$cD = str_replace("<br />","",$cD2);
/**** Then I echo it ****/
<form name="editListing" action="<? echo $PHP_SELF; ?>" method="post">
<input type="hidden" name="listid" value="<? echo $lid; ?>">
<tr valign="top"><td>
Description:
</td><td colspan="6">
<textarea name="clubDesc" cols="50" rows="10" onFocus="this.select();" value="<? echo $cD; ?>"><? echo $cD; ?></textarea>
</td></tr>
</form>
Any suggestions? Are there restraints on <textarea> fields?