MySql Max entry length

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Linkjames
Forum Commoner
Posts: 90
Joined: Tue Sep 16, 2003 8:39 am

MySql Max entry length

Post by Linkjames »

What is the maximum amount of data you can store in a single row? I have a site that requires large amounts of text to be stored per row? Is there any way I can achive this?
Linkjames
Forum Commoner
Posts: 90
Joined: Tue Sep 16, 2003 8:39 am

Post by Linkjames »

Let me make that a little clearer. I have the following page...

Code: Select all

<?php 
if ($_POST['c'] != 1) 
{ 
?> 
<form name="form1" action="faq.php" method="POST"> 
    <input type="hidden" name="c" value="1">
    <input name="question" type="text" id="question" value="Enter question here" size="50">
  <br>
  <textarea name="answer" cols="50" rows="5" id="answer">Enter answer here</textarea>
  <br>
  <input type="submit" value="Search!">
</form> 
<?php 
} else if ($_POST['c']==1) { 
include("connect.php");
include("dbselect.php");
$question = $_POST['question'];
$answer = $_POST['answer'];
$result = @mysql_query("INSERT INTO faq (question, answer) VALUES ('$question','$answer')");
echo 'FAQ Updated';
echo '<P> Click <a href="faq.php">here</a> to make another entry';
}
?>
It will let me input small amounts of data and submit it, but long paragraphs simply disapear. Any ideas?
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

Depends entirely on what sort of db field you're entering the data into. Text blobs can be pretty huge, but also slow. So check and see what your table is using.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Check out the info on column types at mysql.com

You can download a copy of the manual - worth getting.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

If you are using VARCHAR fields, the maximum you will be able to store in them is 255 characters. For large amounts of data, a TEXT or BLOB field would be more appropriate:
http://www.mysql.com/doc/en/BLOB.html

Mac
Post Reply