Page 1 of 1

MySql Max entry length

Posted: Mon Sep 22, 2003 3:18 pm
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?

Posted: Mon Sep 22, 2003 3:32 pm
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?

Posted: Mon Sep 22, 2003 6:24 pm
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.

Posted: Mon Sep 22, 2003 6:46 pm
by McGruff
Check out the info on column types at mysql.com

You can download a copy of the manual - worth getting.

Posted: Tue Sep 23, 2003 3:31 am
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