Forum Moderators: coopster

Message Too Old, No Replies

Newbie Question - 1000 character limit?

How do I increase it in my php+mysql setup...

         

timothius

10:21 am on Jun 28, 2011 (gmt 0)

10+ Year Member



Hi there,

Sorry for the novice question, but I've been searching for quite some time and can't find a definitive answer on this.

So I have a site where users can submit opinions on various stuff. I just found out I had this problem when a user sent one in recently and I found that my code wouldn't save all of her text to the database, but instead cut it off at exactly 1000 characters including spaces.

My question: How do I increase the character limit for user-submitted text content? Thank-you so much for reading and (hopefully) replying... :)

Here is example code:

 if($_POST['update']){
mysql_query("UPDATE ".table_opinion." SET
`summary` = '".$_POST['summary']."',
`review` = '".$_POST['opinion']."',
WHERE `id` = '".$_GET['eid']."'
");
echo "<tr><td>";
echo mysql_error();
echo "Changes Saved!";
?><META HTTP-EQUIV=Refresh CONTENT="1; URL=admin.php"><?php
echo "</td></tr>";
exit();



Update: I'm just wondering out loud here... is it more likely a problem with the table design of my DB or the PHP?

timothius

10:30 am on Jun 28, 2011 (gmt 0)

10+ Year Member



Sorry guys, seems like my problem was that the opinion field in my DB was of the varchar type.

topr8

1:26 pm on Jun 28, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



FYI from mySQl 5.0.3+ the limit for varchar is 65,535

however the field could have been set as varchar(1000) which would have limited you to 1,000 characters.

timothius

5:51 pm on Jun 28, 2011 (gmt 0)

10+ Year Member



@topr8

Right, thanks for replying.