...

View Full Version : question about textarea



sudhakararaog
12-30-2007, 05:49 AM
hi

i am planning to use a feedback form on the website for users to send their feedback. apart from a few textfields i want to use a textarea where the user will enter their feedback. since the feedback could be long at times, in the database i will define this field as long datatype

my question is

1.
i will define the field in the table as ex: comments longtext, is this correct

2.
also since the comments can be very long are there any potential issues in the data being inserted into mysql database. will the entire data be captured or only a portion of it

3.
will all the comments be captured in the excel sheet when exporting the table as an excel sheet.

please advice.

waiting for reply.

Majoracle
12-30-2007, 09:52 AM
1.
That would be correct.

CREATE TABLE table_name (comments longtext)

2.
longtext will store up to 4 GBs or 4,294,967,295 characters. Unless someone plans on writing feedback for your site that exceeds the length of the Bible, you're safe. That said, longtext maybe overdoing it. There's 4 "text" column types:

tinytext = max 255 characters
text = max 65,535 characters
mediumtext = max 16,777,215 characters
longtext = max 4,294,967,295 characters

Regardless of which you use, you should probably have another way of maximizing the length of the string; done through PHP. Ex:

if(strlen($_POST[comment]) > 50000){
exit("Comment is too long!");
}

3.
I don't anything about excel sheets. Someone else will have to help you here. Sorry.

StupidRalph
12-31-2007, 12:01 PM
How are you going to export it to an excel sheet? I'm pretty sure you'll just pass it a query and the results are returned and made into a .csv file or something.

StupidRalph
12-31-2007, 12:03 PM
You also might want to mention the type and version of the database you're using.

JohnDubya
12-31-2007, 08:25 PM
How are you going to export it to an excel sheet? I'm pretty sure you'll just pass it a query and the results are returned and made into a .csv file or something.

You can export database data into an Excel spreadsheet through phpMyAdmin.

JohnDubya
12-31-2007, 08:27 PM
2.
also since the comments can be very long are there any potential issues in the data being inserted into mysql database. will the entire data be captured or only a portion of it

3.
will all the comments be captured in the excel sheet when exporting the table as an excel sheet.

please advice.

waiting for reply.

When I want to allow my users to input a large amount of text into my database, I always use TEXT. It seems to work great for most normal purposes (besides whole books and such). As for the Excel sheet, if you export from phpMyAdmin or other similar program, the input from the TEXT field should export just fine.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum