How to save long text from textarea-input line per line
i have a form with a text area, i wanna save a long text line per line in mysql
i have no idea
$handle = fopen("inputfile.txt", "r");
if ($handle) {
while (($line = fgets($handle)) !== false) {
// process the line read.
}
fclose($handle);
}
2
Answers
You need to learn how mysql interacts with the DB. You will likely need to use VARCHAR datatype depending on how big you text area is. So if the field from the from is up to 250 characters then the text area column’s datatype would be VARCHAR(250).
You would do a POST request to a file with something like this:
Two links I highly suggested looking at:
How to filter inputs via php(used before sql execution)
PHP MySQL Insert Data
It would have been easier if I had a look at your form data. I’ll assume my own form data to try and answer your question.
form.php
Then processing.php